Index: trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- trunk/psModules/src/objects/pmPSFtry.c	(revision 6910)
+++ trunk/psModules/src/objects/pmPSFtry.c	(revision 6943)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-19 20:37:35 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-04-21 21:26:22 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -67,4 +67,6 @@
     test->fitMag   = psVectorAlloc (sources->n, PS_TYPE_F64);
     test->mask     = psVectorAlloc (sources->n, PS_TYPE_U8);
+    test->metric->n = test->fitMag->n = test->mask->n = sources->n;
+    test->modelEXT->n = test->modelPSF->n = sources->n;
 
     for (int i = 0; i < test->modelEXT->n; i++) {
@@ -190,4 +192,5 @@
     psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
     psVector *mask  = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK);
+    flux->n = mask->n = chisq->n = psfTry->sources->n;
 
     // write sources with models first
@@ -211,5 +214,5 @@
     psVectorClipFitPolynomial1D (psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux);
     for (int i = 0; i < psfTry->psf->ChiTrend->nX + 1; i++) {
-        psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]);
+        psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]*pow(10000,i));
     }
     psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev);
@@ -239,4 +242,6 @@
     // r2rflux = radius^2 * ten(0.4*fitMag);
     psVector *r2rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
+    r2rflux->n = psfTry->sources->n;
+
     for (int i = 0; i < psfTry->sources->n; i++) {
         if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL)
