Index: trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- trunk/psphot/src/psphotReadoutCleanup.c	(revision 13808)
+++ trunk/psphot/src/psphotReadoutCleanup.c	(revision 13831)
@@ -5,4 +5,14 @@
 // case, or if the fail on the stats measurement, do we return false
 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) {
+
+    // remove internal pmFPAfiles, if created
+    bool status = true;
+    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
+    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
+    status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
+    if (!status) {
+	psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
+	return false;
+    }
 
     if (psErrorCodeLast() == PSPHOT_ERR_DATA) {
@@ -14,6 +24,4 @@
     // use the psf-model to measure FWHM stats
     if (psf) {
-	// don't call psphotPSFstats unless we have a valid pdf
-	// if it fails, there is probably a programming error 
         if (!psphotPSFstats (readout, recipe, psf)) {
             psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters");
@@ -21,4 +29,5 @@
         }
     }
+    // otherwise, use the source moments to measure FWHM stats
     if (!psf && sources) {
         if (!psphotMomentsStats (readout, recipe, sources)) {
@@ -45,9 +54,4 @@
     }
 
-    // remove internal pmFPAfiles, if created
-    pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
-    pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
-    pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
-
     if (psErrorCodeLast() != PS_ERR_NONE) {
         psErrorStackPrint(stderr, "unexpected remaining errors");
