Index: branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c
===================================================================
--- branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c	(revision 41932)
+++ branches/eam_branches/ipp-20211108/psModules/src/imcombine/pmStack.c	(revision 41933)
@@ -1515,5 +1515,4 @@
 }
 
-# define MIN_GOOD_PERCENTILE 2
 # define SUSPECT_FRACTION 0.65
 
@@ -1610,4 +1609,5 @@
 		if (fabs(image->data.F32[yIn][xIn]) > 1e5) continue; // XXX this cut is a bit arbitrary..
 		if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & badMaskBits) continue;
+		if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & suspectMaskBits) continue;
 
 		// count the number of times a given mask bit is set in the input pixels.
@@ -1629,5 +1629,4 @@
 		// accumulate exposure times if required
 		if (expTime)  { expTime->data.F32[nGood] = data->exp; }
-
 		nGood ++;
 	    }
@@ -1641,5 +1640,8 @@
 	    // rejection needs to be symmetric
 
-# define AT_LEAST 0
+	    // 'AT_LEAST' means we reject at least 'rejectFraction' of values, but it could
+	    // be a higher percentage for smaller numbers of inputs.
+# define AT_LEAST 1
+# define MIN_GOOD_PERCENTILE 3
 # if (AT_LEAST)
 	    int Ns = MIN(MAX(1, 0.5*rejectFraction * nGood), nGood);
