Index: trunk/psphot/src/psphotApResid.c
===================================================================
--- trunk/psphot/src/psphotApResid.c	(revision 17288)
+++ trunk/psphot/src/psphotApResid.c	(revision 18555)
@@ -25,11 +25,14 @@
     }
 
-    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
-    psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels
+    // bit-masks to test for good/bad pixels
+    psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT");
     assert (maskVal);
 
-    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
-    psMaskType mark = psMetadataLookupU8(&status, recipe, "MASK.MARK"); // Mask value for bad pixels
-    assert (mark);
+    // bit-mask to mark pixels not used in analysis
+    psMaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT");
+    assert (markVal);
+
+    // maskVal is used to test for rejected pixels, and must include markVal
+    maskVal |= markVal;
 
     // S/N limit to perform full non-linear fits
@@ -65,5 +68,5 @@
     psf->growth = pmGrowthCurveAlloc (PSF_FIT_PAD, 100.0, REF_RADIUS);
 
-    if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, mark)) {
+    if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) {
         psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections");
         psFree(psf->growth); psf->growth = NULL;
@@ -92,5 +95,5 @@
         // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures
         // will fail if below S/N threshold or model is missing
-        if (!pmSourceMagnitudes (source, psf, photMode, maskVal, mark)) {
+        if (!pmSourceMagnitudes (source, psf, photMode, maskVal)) {
             Nskip ++;
 	    psTrace ("psphot", 3, "skip : bad source mag");
