Index: /trunk/psphot/src/psphot.h
===================================================================
--- /trunk/psphot/src/psphot.h	(revision 36116)
+++ /trunk/psphot/src/psphot.h	(revision 36117)
@@ -475,5 +475,5 @@
 bool psphotSourceChildren (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc);
 bool psphotSourceChildrenReadout (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc, int index);
-psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc);
+psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc, bool sourcesSubtracted);
 
 bool psphotSourceParents (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc);
Index: /trunk/psphot/src/psphotMergeSources.c
===================================================================
--- /trunk/psphot/src/psphotMergeSources.c	(revision 36116)
+++ /trunk/psphot/src/psphotMergeSources.c	(revision 36117)
@@ -812,5 +812,5 @@
 // array containing the child sources.  XXX currently, this is only used by psphotStackReadout
 // (sources go on allSources so that psphotChoosePSF can be called repeatedly)
-psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc) {
+psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc, bool sourcesSubtracted) {
 
     bool status;
@@ -919,5 +919,10 @@
 	    // child sources have not been subtracted in this image, but this flag may be raised if
 	    // they were subtracted in the parent's image
-	    sourceOut->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
+	    // XXX NOTE : in the pre-20130914 version of psphotStack, we carried a copy of the pixels 
+	    // generated before the subtraction took place (and then we smoothed to match the desired PSF).  
+	    // in the new version, we copy the image after subtraction; we need to distinguish these cases
+	    if (!sourcesSubtracted) {
+		sourceOut->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED;
+	    }
 
 	    // set the output detections:
