Index: trunk/psModules/src/imcombine/pmStackReject.c
===================================================================
--- trunk/psModules/src/imcombine/pmStackReject.c	(revision 14701)
+++ trunk/psModules/src/imcombine/pmStackReject.c	(revision 15443)
@@ -52,13 +52,15 @@
 
     // Convolve the image with the kernel --- we're basically applying a matched filter and then thresholding
-    psImage *convolved = NULL;          // Convolved image
+    pmReadout *convRO = pmReadoutAlloc(NULL); // Readout with convolved image
+    pmReadout *inRO = pmReadoutAlloc(NULL); // Readout with input image
+    inRO->image = image;
     for (int i = 0; i < numRegions; i++) {
         psRegion *region = regions->data[i]; // Region of interest
         psVector *solution = solutions->data[i]; // Solution of interest
-        if (!pmSubtractionConvolve(&convolved, NULL, NULL, image, NULL, NULL, 0,
-                                   region, solution, kernels, true)) {
+        if (!pmSubtractionConvolve(convRO, inRO, NULL, NULL, 0, region, solution, kernels, true,
+                                   PM_SUBTRACTION_MODE_1)) {
             psError(PS_ERR_UNKNOWN, false, "Unable to convolve mask image in region %d.", i);
-            psFree(convolved);
-            psFree(image);
+            psFree(convRO);
+            psFree(inRO);
             return NULL;
         }
@@ -73,6 +75,6 @@
         if (!kernel) {
             psError(PS_ERR_UNKNOWN, false, "Unable to generate kernel image.");
-            psFree(convolved);
-            psFree(image);
+            psFree(convRO);
+            psFree(inRO);
             return NULL;
         }
@@ -85,8 +87,10 @@
         psFree(kernel);
 
-        psImage *subConv = psImageSubset(convolved, *region); // Sub-image of convolved image
+        psImage *subConv = psImageSubset(convRO->image, *region); // Sub-image of convolved image
         psBinaryOp(subConv, subConv, "*", psScalarAlloc(1.0 / sum, PS_TYPE_F32));
     }
-    psFree(image);
+    psFree(inRO);
+    psImage *convolved = psMemIncrRefCounter(convRO->image);
+    psFree(convRO);
 
     // Threshold the convolved image
