Index: trunk/psModules/src/imcombine/pmSubtractionStamps.c
===================================================================
--- trunk/psModules/src/imcombine/pmSubtractionStamps.c	(revision 15788)
+++ trunk/psModules/src/imcombine/pmSubtractionStamps.c	(revision 15789)
@@ -122,5 +122,5 @@
     }
     int xSize = xMax - xMin, ySize = yMax - yMin; // Size of region of interest
-    int xStamps = xSize / spacing + 1, yStamps = ySize / spacing + 1; // Number of stamps in x and y
+    int xStamps = (float)xSize / spacing + 1, yStamps = (float)ySize / spacing + 1; // Number of stamps
 
     list->num = xStamps * yStamps;
@@ -129,11 +129,11 @@
 
     for (int y = 0, index = 0; y < yStamps; y++) {
-        int yStart = yMin + y * ((float)ySize / (float)(yStamps + 1)); // Subregion starts here
-        int yStop = yMin + (y + 1) * ((float)ySize / (float)(yStamps + 1)) - 1; // Subregion stops here
+        int yStart = yMin + y * ((float)ySize / (float)(yStamps)); // Subregion starts here
+        int yStop = yMin + (y + 1) * ((float)ySize / (float)(yStamps)) - 1; // Subregion stops here
         assert(yStart >= yMin && yStop < yMax);
 
         for (int x = 0; x < xStamps; x++, index++) {
-            int xStart = xMin + x * ((float)xSize / (float)(xStamps + 1)); // Subregion starts here
-            int xStop = xMin + (x + 1) * ((float)xSize / (float)(xStamps + 1)) - 1; // Subregion stops here
+            int xStart = xMin + x * ((float)xSize / (float)(xStamps)); // Subregion starts here
+            int xStop = xMin + (x + 1) * ((float)xSize / (float)(xStamps)) - 1; // Subregion stops here
             assert(xStart >= xMin && xStop < xMax);
 
