Index: trunk/psModules/src/imcombine/pmSubtraction.c
===================================================================
--- trunk/psModules/src/imcombine/pmSubtraction.c	(revision 13365)
+++ trunk/psModules/src/imcombine/pmSubtraction.c	(revision 13366)
@@ -4,6 +4,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-05-11 02:21:01 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-12 02:00:39 $
  *
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -148,7 +148,4 @@
     PS_ASSERT_INT_NONNEGATIVE(footprint, false);
 
-    int kernelSize = kernels->size;     // Half-size of kernel
-    PS_ASSERT_INT_LARGER_THAN(footprint, kernelSize, false);
-
     // Image size
     int numCols = reference->numCols;
@@ -372,9 +369,10 @@
                                                     2.0 * (float)(stamp->y - numRows/2.0) / (float)numRows);
 
-            for (int y = yStamp - footprint; y <= yStamp + footprint; y++) {
-                for (int x = xStamp - footprint; y <= xStamp + footprint; x++) {
+            for (int y = - footprint; y <= footprint; y++) {
+                for (int x = footprint; x <= footprint; x++) {
                     for (int k = 0; k < numKernels; k++) {
-                        convolvedStamp->data.F32[y - yStamp][x - xStamp] +=
-                            convolvePixel(kernels, k, x, y, refImage, polyValues, imageWeighting);
+                        convolvedStamp->data.F32[y + footprint][x + footprint] +=
+                            convolvePixel(kernels, k, xStamp + x, yStamp + y, refImage, polyValues,
+                                          imageWeighting);
                     }
                 }
@@ -382,6 +380,6 @@
             psFree(polyValues);
 
-            psRegion region = psRegionSet(xStamp - footprint, xStamp + footprint,
-                                          yStamp - footprint, yStamp + footprint); // Region of interest
+            psRegion region = psRegionSet(xStamp - footprint, xStamp + footprint + 1,
+                                          yStamp - footprint, yStamp + footprint + 1); // Region of interest
             psImage *inStamp = psImageSubset(inImage, region); // Image of stamp
             assert(inStamp->numCols == convolvedStamp->numCols &&
