Index: branches/simmosaic_branches/ppSub/src/ppSubReadoutSubtract.c
===================================================================
--- branches/simmosaic_branches/ppSub/src/ppSubReadoutSubtract.c	(revision 24860)
+++ branches/simmosaic_branches/ppSub/src/ppSubReadoutSubtract.c	(revision 27839)
@@ -45,20 +45,4 @@
     }
 
-// XXX this should be replaced by SAVE options to the inConv and refConf pmFPAfiles
-#ifdef TESTING
-    {
-        pmReadoutMaskApply(minuend, maskVal);
-        psFits *fits = psFitsOpen("minuend.fits", "w");
-        psFitsWriteImage(fits, NULL, minuend->image, 0, NULL);
-        psFitsClose(fits);
-    }
-    {
-        pmReadoutMaskApply(subtrahend, maskVal);
-        psFits *fits = psFitsOpen("subtrahend.fits", "w");
-        psFitsWriteImage(fits, NULL, subtrahend->image, 0, NULL);
-            psFitsClose(fits);
-    }
-#endif
-
     // Do the actual subtraction
     pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
@@ -87,5 +71,5 @@
     pmFPA *outFPA = outFile->fpa;       // Output FPA
     if (!pmConceptsCopyFPA(outFPA, inFPA, true, true)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to copy concepts from input to output.");
+        psError(PPSUB_ERR_CONFIG, false, "Unable to copy concepts from input to output.");
         psFree(outRO);
         psFree(view);
@@ -100,13 +84,13 @@
     psFree(view);
     if (!outHDU || !inHDU) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to find HDU at FPA level to copy astrometry.");
+        psError(PPSUB_ERR_PROG, true, "Unable to find HDU at FPA level to copy astrometry.");
         return false;
     }
     if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to read WCS astrometry from input FPA.");
+        psError(psErrorCodeLast(), false, "Unable to read WCS astrometry from input FPA.");
         return false;
     }
     if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to write WCS astrometry to output FPA.");
+        psError(psErrorCodeLast(), false, "Unable to write WCS astrometry to output FPA.");
         return false;
     }
