Index: /trunk/psphot/src/psphotLoadPSF.c
===================================================================
--- /trunk/psphot/src/psphotLoadPSF.c	(revision 13528)
+++ /trunk/psphot/src/psphotLoadPSF.c	(revision 13529)
@@ -16,4 +16,9 @@
 
     if (!psphotPSFstats (readout, recipe, psf)) psAbort("cannot measure PSF shape terms");
+
+    psLogMsg ("psphot", 3, "using externally supplied PSF model for this readout");
+
+    // we return a psf which can be free (and which may be removed from the metadata)
+    psMemIncrRefCounter (psf);
     return psf;
 }
Index: /trunk/psphot/src/psphotMakeResiduals.c
===================================================================
--- /trunk/psphot/src/psphotMakeResiduals.c	(revision 13528)
+++ /trunk/psphot/src/psphotMakeResiduals.c	(revision 13529)
@@ -12,11 +12,5 @@
 
     int SPATIAL_ORDER = psMetadataLookupS32(&status, recipe, "PSF.RESIDUALS.SPATIAL_ORDER");
-#if 0					// True when PSF.RESIDUALS.SPATIAL_ORDER's in default recipe
-    PS_ASSERT (status, false);
-#else
-    if (!status) {
-	SPATIAL_ORDER = 1;		// i.e. linear
-    }
-#endif
+    PS_ASSERT (status, false);
     if (SPATIAL_ORDER != 0 && SPATIAL_ORDER != 1) {
 	psError(PSPHOT_ERR_CONFIG, true, "PSF.RESIDUALS.SPATIAL_ORDER must be 0 or 1 (not %d)",
Index: /trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- /trunk/psphot/src/psphotReadoutCleanup.c	(revision 13528)
+++ /trunk/psphot/src/psphotReadoutCleanup.c	(revision 13529)
@@ -40,5 +40,7 @@
     }
     if (psf) {
-	psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
+	// save the psf for possible output.  if there was already an entry, it was loaded from external sources
+	// the new one may have been updated or modified, so replace the existing entry
+	psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN | PS_META_REPLACE,  "psphot psf", psf);
     }
 
@@ -48,5 +50,8 @@
     pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
 
-    if (psErrorCodeLast() != PS_ERR_NONE) abort();
+    if (psErrorCodeLast() != PS_ERR_NONE) {
+        psErrorStackPrint(stderr, "unexpected remaining errors");
+	abort();
+    }
 
     // XXX move this to top of loop
