Index: trunk/psphot/src/psphotBasicDeblend.c
===================================================================
--- trunk/psphot/src/psphotBasicDeblend.c	(revision 29936)
+++ trunk/psphot/src/psphotBasicDeblend.c	(revision 31154)
@@ -63,5 +63,5 @@
     for (int i = 0; i < SN->n; i++) {
         source = sources->data[i];
-        SN->data.F32[i] = source->peak->SN;
+        SN->data.F32[i] = source->peak->rawFlux;
     }
     psVector *index = psVectorSortIndex (NULL, SN);
@@ -115,5 +115,5 @@
         // threshold is fraction of the source peak flux
         // image is background subtracted; source->moments->Sky should always be 0.0
-        threshold = FRACTION * source->peak->SN;
+        threshold = FRACTION * sqrt(source->peak->detValue);
         // threshold is no less than NSIGMA
         threshold = PS_MAX (threshold, NSIGMA);
@@ -138,5 +138,5 @@
             testSource = overlap->data[k];
 	    if (testSource->mode & PM_SOURCE_MODE_BLEND) continue;
-            if (testSource->peak->value > source->peak->value) continue;
+            if (testSource->peak->rawFlux > source->peak->rawFlux) continue;
             for (int j = 0; j < xv->n; j+=2) {
                 if (fabs(yv->data.F32[j] - testSource->peak->y) > 0.5) continue;
