Index: trunk/psModules/src/imcombine/pmSubtractionParams.c
===================================================================
--- trunk/psModules/src/imcombine/pmSubtractionParams.c	(revision 26893)
+++ trunk/psModules/src/imcombine/pmSubtractionParams.c	(revision 27086)
@@ -8,4 +8,5 @@
 #include <pslib.h>
 
+#include "pmErrorCodes.h"
 #include "pmSubtractionStamps.h"
 #include "pmSubtraction.h"
@@ -281,5 +282,5 @@
         }
         if (!pmSubtractionConvolveStamp(stamp, kernels, footprint)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to convolve stamp %d.", i);
+            psError(psErrorCodeLast(), false, "Unable to convolve stamp %d.", i);
             psFree(targets);
             psFree(kernels);
@@ -297,5 +298,5 @@
         }
         if (!isfinite(sum1)) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+            psError(PM_ERR_DATA, true,
                     "Sum of 1/sigma^2 is non-finite for stamp %d (%d,%d)\n",
                     i, (int)stamp->x, (int)stamp->y);
@@ -369,5 +370,5 @@
 
         if (bestIndex == -1) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to find best kernel component in round %d.", iter);
+            psError(PM_ERR_DATA, true, "Unable to find best kernel component in round %d.", iter);
             psFree(targets);
             psFree(sumC);
@@ -408,5 +409,5 @@
 
     if (cutIndex < 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to converge to tolerance %g\n", tolerance);
+        psError(PM_ERR_DATA, true, "Unable to converge to tolerance %g\n", tolerance);
         psFree(ranking);
         psFree(kernels);
