Index: trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- trunk/psModules/src/imcombine/pmStack.c	(revision 16689)
+++ trunk/psModules/src/imcombine/pmStack.c	(revision 16691)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-02-28 00:15:03 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-02-28 01:15:35 $
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
  *
@@ -60,6 +60,5 @@
 }
 
-static combineBuffer *combineBufferAlloc(long numImages, // Number of images that will be combined
-                                         psStatsOptions stat // Statistic to use
+static combineBuffer *combineBufferAlloc(long numImages // Number of images that will be combined
     )
 {
@@ -231,5 +230,4 @@
     assert(inputs);
     assert(numIter >= 0);
-    assert(rej > 0);
     assert(buffer);
     assert((useVariance && variance) || !useVariance);
@@ -311,5 +309,5 @@
               }
           }
-          if (useVariance && safe) {
+          if (useVariance && safe && numIter > 0) {
               // Use variance to check that the two are consistent
               float diff = pixelData->data.F32[0] - pixelData->data.F32[1];
@@ -542,5 +540,5 @@
     PS_ASSERT_INT_NONNEGATIVE(numIter, false);
     if (isnan(rej)) {
-        PS_ASSERT_INT_EQUAL(numIter, 0);
+        PS_ASSERT_INT_EQUAL(numIter, 0, false);
     } else {
         PS_ASSERT_FLOAT_LARGER_THAN(rej, 0.0, false);
@@ -598,6 +596,5 @@
 
     // Buffer for combination
-    combineBuffer *buffer = combineBufferAlloc(num, numIter == 0 ? PS_STAT_SAMPLE_MEAN :
-                                               PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_MEDIAN);
+    combineBuffer *buffer = combineBufferAlloc(num);
 
     if (havePixels) {
@@ -615,5 +612,4 @@
             }
             pixels = psPixelsConcatenate(pixels, data->pixels);
-            data->pixels = psPixelsRealloc(data->pixels, PIXEL_LIST_BUFFER); // Just in case more rejection
         }
         for (int i = 0; i < pixels->n; i++) {
@@ -627,5 +623,4 @@
                           maskVal, bad, numIter, rej, useVariance, safe, buffer);
         }
-        psTrace("psModules.imcombine", 5, "Additional %ld pixels fixed.\n", pixels->n);
         psFree(pixels);
         psFree(pixelMap);
