Index: trunk/ppSub/src/ppSubReadout.c
===================================================================
--- trunk/ppSub/src/ppSubReadout.c	(revision 20516)
+++ trunk/ppSub/src/ppSubReadout.c	(revision 20518)
@@ -338,7 +338,4 @@
 #endif
 
-    outRO->mask = (psImage*)psBinaryOp(outRO->mask, inConv->mask, "|", refConv->mask);
-    outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true; // It'll be there soon
-
     // Photometry is to be performed in two stages:
     // 1. Measure the PSF using the PSF-matched images
@@ -353,4 +350,5 @@
             outRO->weight = psImageCopy(outRO->weight, minuend->weight, PS_TYPE_F32);
         }
+        outRO->mask = psImageCopy(outRO->mask, minuend->mask, PS_TYPE_MASK);
 
         pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT");
@@ -409,4 +407,6 @@
         outRO->weight = (psImage*)psBinaryOp(outRO->weight, inConv->weight, "+", refConv->weight);
     }
+    outRO->mask = (psImage*)psBinaryOp(outRO->mask, inConv->mask, "|", refConv->mask);
+
     outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true;
 
@@ -434,7 +434,7 @@
     if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {
         // Statistics for renormalisation
-        psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
+        psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
                                                                                 "RENORM.MEAN"));
-        psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe,
+        psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,
                                                                                  "RENORM.STDEV"));
         if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {
