Index: /branches/eam_branches/20090715/psModules/src/objects/pmPSFtryMakePSF.c
===================================================================
--- /branches/eam_branches/20090715/psModules/src/objects/pmPSFtryMakePSF.c	(revision 25695)
+++ /branches/eam_branches/20090715/psModules/src/objects/pmPSFtryMakePSF.c	(revision 25696)
@@ -103,8 +103,10 @@
         }
 
+	pmTrend2D *trend = psf->params->data[i];
+
         // fit the collection of measured parameters to the PSF 2D model
         // the mask is carried from previous steps and updated with this operation
         // the weight is either the flux error or NULL, depending on 'psf->poissonErrorParams'
-        if (!pmTrend2DFit (psf->params->data[i], srcMask, 0xff, x, y, z, NULL)) {
+        if (!pmTrend2DFit (trend, srcMask, 0xff, x, y, z, NULL)) {
             psError(PS_ERR_UNKNOWN, false, "failed to build psf model for parameter %d", i);
             psFree(x);
@@ -113,4 +115,9 @@
             return false;
         }
+	if (trend->mode == PM_TREND_MAP) {
+	    // p_psImagePrint (2, trend->map->map, "param N Before"); // XXX TEST:
+	    psImageMapRepair (trend->map->map);
+	    // p_psImagePrint (2, trend->map->map, "param N After"); // XXX TEST:
+	}
     }
 
