Index: branches/pap/psModules/src/imcombine/pmStack.c
===================================================================
--- branches/pap/psModules/src/imcombine/pmStack.c	(revision 25938)
+++ branches/pap/psModules/src/imcombine/pmStack.c	(revision 25948)
@@ -30,10 +30,10 @@
 #define PIXEL_LIST_BUFFER 100           // Number of entries to add to pixel list at a time
 #define PIXEL_MAP_BUFFER 2              // Number of entries to add to pixel map at a time
-//#define ADD_VARIANCE                    // Allow additional variance (besides variance factor)?
+#define ADD_VARIANCE                    // Allow additional variance (besides variance factor)?
 #define NUM_DIRECT_STDEV 5              // For less than this number of values, measure stdev directly
 
-#define TESTING                         // Enable test output
-#define TEST_X -1                     // x coordinate to examine
-#define TEST_Y -1                     // y coordinate to examine
+//#define TESTING                         // Enable test output
+//#define TEST_X 3349-1                     // x coordinate to examine
+//#define TEST_Y 2278-1                     // y coordinate to examine
 
 
@@ -641,5 +641,5 @@
     mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = num;
     if (variance) {
-        variance->data.F32[y][x] = 1.0 - (float)numRejected / (float)num;
+        variance->data.F32[y][x] = num > 0 ? 1.0 - (float)numRejected / (float)num : 0.0;
     }
 #endif
