Index: /trunk/ppMerge/src/ppMergeCombine.c
===================================================================
--- /trunk/ppMerge/src/ppMergeCombine.c	(revision 10269)
+++ /trunk/ppMerge/src/ppMergeCombine.c	(revision 10270)
@@ -151,10 +151,18 @@
                     // Only reading and writing the first readout in each cell (plane 0)
                     if (pmReadoutReadNext(stack->data[i], fits, 0, options->rows)) {
-                        // For anything except BIAS and DARK, we want a mask
-                        if (options->scale || options->zero || options->shutter) {
+                        // If the mask value is set, we want to generate a mask
+                        if (options->combine->maskVal) {
                             pmReadoutSetMask(stack->data[i]);
                         }
-                        if (options->shutter) {
-                            pmReadoutSetWeight(stack->data[i]);
+
+                        // If we're combining with weights, we want to generate weights.
+                        if (options->combine->weights) {
+
+                            // If it's a bias or dark, set the gain to zero: noise only contributed by read
+                            if ((!options->zero && !options->scale) || options->darktime) {
+                                pmReadoutSetWeight(stack->data[i], false);
+                            } else {
+                                pmReadoutSetWeight(stack->data[i], true);
+                            }
                         }
 
Index: /trunk/ppMerge/src/ppMergeOptions.c
===================================================================
--- /trunk/ppMerge/src/ppMergeOptions.c	(revision 10269)
+++ /trunk/ppMerge/src/ppMergeOptions.c	(revision 10270)
@@ -58,4 +58,5 @@
     options->combine->nKeep = 1;
     options->combine->maskVal = 0xff;
+    options->combine->weights = false;
 
     return options;
@@ -67,10 +68,12 @@
 
 // Parse a recipe option according to its type
-#define OPTION_PARSE(OPTION,MD,NAME,TYPE)                                                                    \
-{                                                                                                            \
-    psMetadataItem *item = psMetadataLookup(MD, NAME);                                                       \
-    if (item) {                                                                                              \
-        OPTION = psMetadataItemParse##TYPE(item);                                                            \
-    }                                                                                                        \
+#define OPTION_PARSE(OPTION,MD,NAME,TYPE) \
+{ \
+    psMetadataItem *item = psMetadataLookup(MD, NAME); \
+    if (item) { \
+        OPTION = psMetadataItemParse##TYPE(item); \
+    } else { \
+        psWarning("Recipe option %s isn't specified; using default.\n", NAME); \
+    } \
 }
 
@@ -139,4 +142,5 @@
     OPTION_PARSE(options->combine->nKeep,    recipe, "NKEEP",          S32);
     OPTION_PARSE(options->combine->maskVal,  recipe, "MASKVAL",        S32);
+    OPTION_PARSE(options->combine->weights,  recipe, "WEIGHTS",        Bool);
     OPTION_PARSE(options->fringeNum,         recipe, "FRINGE.NUM",     S32);
     OPTION_PARSE(options->fringeSize,        recipe, "FRINGE.SIZE",    S32);
