Index: trunk/psphot/src/psphotMaskReadout.c
===================================================================
--- trunk/psphot/src/psphotMaskReadout.c	(revision 28013)
+++ trunk/psphot/src/psphotMaskReadout.c	(revision 29936)
@@ -9,6 +9,5 @@
     psAssert (recipe, "missing recipe?");
 
-    int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
-    psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
+    int num = psphotFileruleCount(config, filerule);
 
     // loop over the available readouts
@@ -17,5 +16,5 @@
 	// Generate the mask and weight images, including the user-defined analysis region of interest
 	if (!psphotSetMaskAndVarianceReadout (config, view, filerule, i, recipe)) {
-            psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for PSPHOT.INPUT entry %d", i);
+	    psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for %s entry %d", filerule, i);
 	    return false;
 	}
