Index: /trunk/archive/scripts/src/phase2/papPhase2.c
===================================================================
--- /trunk/archive/scripts/src/phase2/papPhase2.c	(revision 5463)
+++ /trunk/archive/scripts/src/phase2/papPhase2.c	(revision 5464)
@@ -577,13 +577,11 @@
 					    if (coeff->type.type != PS_TYPE_F64) {
 						psVector *temp = psVectorCopy(NULL, coeff, PS_TYPE_F64);
-						psFree(coeff);
 						coeff = temp;
 					    }
 					    // Polynomial correction
-					    psPolynomial1D *correction = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD,
-											     coeff->n + 1);
-					    for (int i = 0; i < coeff->n; i++) {
-						correction->coeff[i] = coeff->data.F64[i];
-					    }
+					    psPolynomial1D *correction = psPolynomial1DAlloc(coeff->n - 1,
+											     PS_POLYNOMIAL_ORD);
+					    psFree(correction->coeff);
+					    correction->coeff = psMemIncrRefCounter(coeff->data.F64);
 					    (void)pmNonLinearityPolynomial(inputReadout, correction);
 					    psFree(coeff);
@@ -726,9 +724,12 @@
 		}
 
+		// XXX: Temporary: until the other functions are altered to do this themselves.
 		// Trim, so that flat, fringe etc computations are faster.
+#ifndef PRODUCTION
 		psRegion *trimRegion = psMetadataLookupPtr(NULL, inputCell->concepts, "CELL.TRIMSEC");
 		psImage *trimmed = psImageSubset(inputReadout->image, *trimRegion);
 		psFree(inputReadout->image);
 		inputReadout->image = trimmed;
+#endif
 
 		// Flat-field correction
Index: /trunk/archive/scripts/src/phase2/phase2.config
===================================================================
--- /trunk/archive/scripts/src/phase2/phase2.config	(revision 5463)
+++ /trunk/archive/scripts/src/phase2/phase2.config	(revision 5464)
@@ -20,5 +20,5 @@
 	@ccd01		F32	0.0 1.001 0.001	# A polynomial
 	@ccd02		F32	0.0 1.001 0.001	# A polynomial
-	@ccd03		F32	0.0 1.001 0.001	# A polynomial
+	@ccd03		F32	1.2345 		# A polynomial
 	@ccd04		F32	0.0 1.001 0.001	# A polynomial
 	@ccd05		F32	0.0 1.001 0.001	# A polynomial
Index: /trunk/archive/scripts/src/phase2/pmNonLinear.c
===================================================================
--- /trunk/archive/scripts/src/phase2/pmNonLinear.c	(revision 5463)
+++ /trunk/archive/scripts/src/phase2/pmNonLinear.c	(revision 5464)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-23 02:58:30 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-03 03:21:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -24,5 +24,5 @@
 
 /******************************************************************************
-pmNonLinearityLookup(): This routine will take an psReadout image as input
+pmNonLinearityLookup(): This routine will take an pmReadout image as input
 and a 1-D polynomial.  For each pixel in the input image, the polynomial will
 be evaluated at that pixels value, and the image pixel will then be set to
@@ -51,5 +51,5 @@
 
 /******************************************************************************
-pmNonLinearityLookup(): This routine will take an psReadout image as input
+pmNonLinearityLookup(): This routine will take an pmReadout image as input
 and two input vectors, which constitute a lookup table.  For each pixel in
 the input image, that pixels value will be determined in the input vector
Index: /trunk/archive/scripts/src/phase2/pmNonLinear.h
===================================================================
--- /trunk/archive/scripts/src/phase2/pmNonLinear.h	(revision 5463)
+++ /trunk/archive/scripts/src/phase2/pmNonLinear.h	(revision 5464)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-23 02:58:30 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-03 03:21:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,5 +16,5 @@
 
 #include "pslib.h"
-#include "pmFPA.h"
+#include "pmFPA.h" // #include "pmAstrometry.h"
 
 pmReadout *pmNonLinearityPolynomial(pmReadout *in,
