Index: trunk/psLib/src/math/psMinimizePolyFit.c
===================================================================
--- trunk/psLib/src/math/psMinimizePolyFit.c	(revision 38062)
+++ trunk/psLib/src/math/psMinimizePolyFit.c	(revision 41532)
@@ -19,4 +19,5 @@
  *  XXX: For clip-fit functions, what should we do if the mask is NULL?
  *
+ *  XXX: the sums are built for 2*(order + 1) elements, but it should be 2*order + 1
  */
 
@@ -2250,5 +2251,5 @@
         }
 
-        if (!psVectorStats (stats, resid, NULL, mask, maskValue)) {
+        if (!psVectorStats(stats, resid, NULL, mask, maskValue)) {
             psError(PS_ERR_UNKNOWN, false, "Could not compute statistics on the resid vector.  Returning NULL.\n");
             psFree(resid);
