Index: /trunk/psModules/src/detrend/pmSubtractBias.c
===================================================================
--- /trunk/psModules/src/detrend/pmSubtractBias.c	(revision 10281)
+++ /trunk/psModules/src/detrend/pmSubtractBias.c	(revision 10282)
@@ -9,7 +9,4 @@
 #include "pmFPA.h"
 #include "pmSubtractBias.h"
-
-#define PM_SUBTRACT_BIAS_POLYNOMIAL_ORDER 2
-#define PM_SUBTRACT_BIAS_SPLINE_ORDER 3
 
 
@@ -215,4 +212,6 @@
     }
 
+    //    psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now, used for reporting
+
     psImage *image = in->image;         // The input image
 
@@ -245,4 +244,5 @@
                 int index = pixels->n;  // Index
                 pixels = psVectorRealloc(pixels, pixels->n + overscan->numRows * overscan->numCols);
+                pixels->n += overscan->numRows * overscan->numCols;
                 // XXX Reimplement with memcpy
                 for (int i = 0; i < overscan->numRows; i++) {
@@ -256,4 +256,5 @@
 
             (void)psVectorStats(stats, pixels, NULL, NULL, 0);
+            psFree(pixels);
             double reduced = psStatsGetValue(stats, statistic); // Result of statistics
             (void)psBinaryOp(image, image, "-", psScalarAlloc((float)reduced, PS_TYPE_F32));
