Index: branches/eam_branches/psphot.stack.20100120/src/psphotSkyReplace.c
===================================================================
--- branches/eam_branches/psphot.stack.20100120/src/psphotSkyReplace.c	(revision 26688)
+++ branches/eam_branches/psphot.stack.20100120/src/psphotSkyReplace.c	(revision 26691)
@@ -5,10 +5,10 @@
     bool status = true;
 
-    int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
+    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
 
     // loop over the available readouts
     for (int i = 0; i < num; i++) {
-	if (!psphotReadout (config, view, "PSPHOT.INPUT", i)) {
+	if (!psphotSkyReplaceReadout (config, view, "PSPHOT.INPUT", i)) {
             psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i);
 	    return false;
@@ -26,5 +26,5 @@
     // find the currently selected readout
     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
-    psAssert (readout, "missing file?");
+    psAssert (file, "missing file?");
 
     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
