Index: trunk/psModules/src/imcombine/pmImageCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmImageCombine.c	(revision 23989)
+++ trunk/psModules/src/imcombine/pmImageCombine.c	(revision 26893)
@@ -118,6 +118,6 @@
             psImage *mask = masks->data[i]; // Mask of interest
             pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[i] = (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal);
-        }        
-	// Set the pixel error data, if necessary
+        }
+        // Set the pixel error data, if necessary
         if (errors) {
             psImage *error = errors->data[i]; // Error image of interest
@@ -132,8 +132,8 @@
         // Combine all the pixels, using the specified stat.
         if (!psVectorStats(stats, pixelData, pixelErrors, pixelMasks, 0xff)) {
-	    psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
-	    return false;
-	}
-	if (isnan(stats->sampleMean)) {
+            psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+            return false;
+        }
+        if (isnan(stats->sampleMean)) {
             combine->data.F32[y][x] = NAN;
             psFree(buffer);
@@ -141,5 +141,5 @@
         }
         float combinedPixel = stats->sampleMean; // Value of the combination
-	
+
         if (iter == 0) {
             // Save the value produced with no rejection, since it may be useful later
@@ -369,5 +369,5 @@
     psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
     if (!psVectorStats(stats, pixels, NULL, mask, 1)) {
-	psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+        psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
     }
     float median = stats->sampleMedian;
@@ -640,6 +640,6 @@
                                               (psPlaneTransform * )outToIn->data[otherImg],
                                               outCoords);
-                        psS32 xPix = (int)(inCoords->x + 0.5);
-                        psS32 yPix = (int)(inCoords->y + 0.5);
+                        psS32 xPix = (int)(inCoords->x - 0.5);
+                        psS32 yPix = (int)(inCoords->y - 0.5);
                         if ((xPix >= 0) && (xPix <= ((psImage*)(images->data[otherImg]))->numCols - 1) &&
                                 (yPix >= 0) && (yPix <= ((psImage*)(images->data[otherImg]))->numRows - 1)) {
