Index: trunk/psphot/src/pmPSFtry.c
===================================================================
--- trunk/psphot/src/pmPSFtry.c	(revision 4977)
+++ trunk/psphot/src/pmPSFtry.c	(revision 5058)
@@ -31,18 +31,17 @@
 pmPSFtry *pmPSFtryAlloc (psArray *sources, char *modelName) {
 
+    pmModelType type;
+
     pmPSFtry *test = (pmPSFtry *) psAlloc(sizeof(pmPSFtry));
 
     // XXX probably need to increment ref counter
-    test->modelType   = pmModelSetType (modelName);
-    test->psf         = pmPSFAlloc (test->modelType);
-    test->sources     = psMemCopy(sources);
-    test->modelFLT    = psArrayAlloc (sources->n);
-    test->modelPSF    = psArrayAlloc (sources->n);
-    test->metric      = psVectorAlloc (sources->n, PS_TYPE_F64);
-    test->fitMag      = psVectorAlloc (sources->n, PS_TYPE_F64);
-    test->mask        = psVectorAlloc (sources->n, PS_TYPE_U8);
-    test->ApResid     = 0;
-    test->dApResid    = 0;
-    test->skyBias     = 0;
+    type           = pmModelSetType (modelName);
+    test->psf      = pmPSFAlloc (type);
+    test->sources  = psMemCopy(sources);
+    test->modelFLT = psArrayAlloc (sources->n);
+    test->modelPSF = psArrayAlloc (sources->n);
+    test->metric   = psVectorAlloc (sources->n, PS_TYPE_F64);
+    test->fitMag   = psVectorAlloc (sources->n, PS_TYPE_F64);
+    test->mask     = psVectorAlloc (sources->n, PS_TYPE_U8);
 
     for (int i = 0; i < test->modelFLT->n; i++) {
@@ -84,5 +83,5 @@
 
 	pmSource *source = try->sources->data[i];
-	pmModel  *model  = pmSourceModelGuess (source, try->modelType); 
+	pmModel  *model  = pmSourceModelGuess (source, try->psf->type); 
 	x = source->peak->x;
 	y = source->peak->y;
@@ -164,5 +163,5 @@
     pmPSFtryMetric (try, RADIUS);
     psLogMsg ("psphot.pspsf", 3, "try model %s, ap-fit: %f +/- %f, sky bias: %f\n", 
-	      modelName, try->ApResid, try->dApResid, try->skyBias);
+	      modelName, try->psf->ApResid, try->psf->dApResid, try->psf->skyBias);
 
     return (try);
@@ -279,7 +278,7 @@
   stats = psVectorStats (stats, daResid, NULL, maskB, 1);
 
-  try->ApResid = poly->coeff[0];
-  try->dApResid = stats->clippedStdev;
-  try->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS));
+  try->psf->ApResid = poly->coeff[0];
+  try->psf->dApResid = stats->clippedStdev;
+  try->psf->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS));
 
   psFree (rflux);
