Index: /branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c
===================================================================
--- /branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c	(revision 36215)
+++ /branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c	(revision 36216)
@@ -155,4 +155,5 @@
     }
     psFree (cellGroups);
+    psFree (fitOptions);
 
     psLogMsg ("psphot.galaxy", PS_LOG_WARN, "measure galaxy shapes : %f sec for %ld objects\n", psTimerMark ("psphot.galaxy"), sources->n);
@@ -253,5 +254,5 @@
 	}
     }
-
+    psFree (pcm);
     return true;
 }
@@ -303,5 +304,5 @@
     float Io = YM / MM;
     float dIo = sqrt (1.0 / MM);
-    float Chisq = YY - 2 * Io * YM + Io * Io * MM;
+    float Chisq = (YY - 2 * Io * YM + Io * Io * MM) / (float) nPix;
 
     // fprintf (stderr, "Io: %f, Chisq: %f\n", Io, Chisq);
