Index: trunk/ppMerge/src/ppMergeCombine.c
===================================================================
--- trunk/ppMerge/src/ppMergeCombine.c	(revision 9996)
+++ 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);
+                            }
                         }
 
