Index: trunk/ppStack/src/ppStackMatch.c
===================================================================
--- trunk/ppStack/src/ppStackMatch.c	(revision 29552)
+++ trunk/ppStack/src/ppStackMatch.c	(revision 30620)
@@ -1,11 +1,2 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-#include <psphot.h>
-
 #include "ppStack.h"
 
@@ -325,15 +316,21 @@
                 // Scale the input parameters
                 psVector *widthsCopy = psVectorCopy(NULL, widths, PS_TYPE_F32); // Copy of kernel widths
-                if (scale && !pmSubtractionParamsScale(&size, &footprint, widthsCopy, scaleRef, scaleMin, scaleMax)) {
-                    psError(psErrorCodeLast(), false, "Unable to scale kernel parameters");
-                    psFree(fake);
-                    psFree(optWidths);
-                    psFree(conv);
-                    psFree(widthsCopy);
-                    if (threads > 0) {
-                        pmSubtractionThreadsFinalize();
-                    }
-                    return false;
-                }
+
+		pmSubtractionParamScaleOptions(scale, scaleRef, scaleMin, scaleMax);
+
+		// XXX EAM : the kernel scaling process has changed: the scale is now set
+		// inside pmSubtractionMatch after the normalization window is measured
+
+                // if (scale && !pmSubtractionParamsScale(&size, &footprint, widthsCopy, scaleRef, scaleMin, scaleMax)) {
+                //     psError(psErrorCodeLast(), false, "Unable to scale kernel parameters");
+                //     psFree(fake);
+                //     psFree(optWidths);
+                //     psFree(conv);
+                //     psFree(widthsCopy);
+                //     if (threads > 0) {
+                //         pmSubtractionThreadsFinalize();
+                //     }
+                //     return false;
+                // }
 
                 if (!pmSubtractionMatch(NULL, conv, fake, readout, footprint, stride, regionSize, spacing,
