Index: trunk/psModules/src/detrend/pmFringeStats.c
===================================================================
--- trunk/psModules/src/detrend/pmFringeStats.c	(revision 34062)
+++ trunk/psModules/src/detrend/pmFringeStats.c	(revision 34085)
@@ -662,5 +662,5 @@
         if (item->type == PS_DATA_VECTOR) { \
             ARRAY->data[i] = psMemIncrRefCounter(item->data.V); \
-        } else if (item->type == PS_TYPE_##TYPE) { \
+        } else if (item->type == PS_DATA_##TYPE) { \
             psVector *vector = psVectorAlloc(1, PS_TYPE_##TYPE); \
             vector->data.TYPE[0] = item->data.TYPE; \
Index: trunk/psModules/src/detrend/pmNonLinear.c
===================================================================
--- trunk/psModules/src/detrend/pmNonLinear.c	(revision 34062)
+++ trunk/psModules/src/detrend/pmNonLinear.c	(revision 34085)
@@ -82,7 +82,7 @@
     }
     PS_ASSERT_PTR_NON_NULL(outFlux,NULL);
-    psS32 tableSize = inFlux->n;
+    // XXX unused psS32 tableSize = inFlux->n;
     if (inFlux->n != outFlux->n) {
-        tableSize = PS_MIN(inFlux->n, outFlux->n);
+        // XXX unused tableSize = PS_MIN(inFlux->n, outFlux->n);
         psLogMsg(__func__, PS_LOG_WARN,
                  "WARNING: pmNonLinear.c: pmNonLinearityLookup(): "
@@ -329,4 +329,6 @@
 
     bin = correction_fluxes->n - 1;
+    psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
+    if (bin < 0) { /* warn? */ }
     if (flux < correction_fluxes->data.F32[0]) {
 	return(0.0);
@@ -357,4 +359,5 @@
     bin = correction_fluxes->n - 1;
     psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
+    if (bin < 0) { /* warn? */ }
     if (flux < correction_fluxes->data.F32[0]) {
 	return(0.0);
Index: trunk/psModules/src/detrend/pmShutterCorrection.c
===================================================================
--- trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 34062)
+++ trunk/psModules/src/detrend/pmShutterCorrection.c	(revision 34085)
@@ -406,5 +406,4 @@
 
     // Check input sizes, generate first-pass statistics
-    psRegion refRegion;                 // Reference region
     psVector *refs = psVectorAlloc(num, PS_TYPE_F32); // Reference measurements
     psVectorInit(refs, 0);
@@ -441,5 +440,5 @@
             numCols = image->numCols;
             // define the reference region : a box of size 'size' at the center
-            refRegion = psRegionForSquare(0.5 * numCols, 0.5 * numRows, size);
+            // XXX unused psRegion refRegion = psRegionForSquare(0.5 * numCols, 0.5 * numRows, size);
             // Set up the sample regions : boxes of size 'size' at the 4 image corners
             for (int j = 0; j < MEASURE_SAMPLES; j++) {
