Index: trunk/psphot/src/psphotReadoutCleanup.c
===================================================================
--- trunk/psphot/src/psphotReadoutCleanup.c	(revision 13008)
+++ 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
