Index: /trunk/ppStack/src/ppStackMatch.c
===================================================================
--- /trunk/ppStack/src/ppStackMatch.c	(revision 18354)
+++ /trunk/ppStack/src/ppStackMatch.c	(revision 18355)
@@ -10,6 +10,8 @@
 
 #define ARRAY_BUFFER 16                 // Number to add to array at a time
-#define MAG_IGNORE 99.0                 // Ignore these magnitudes --- they're not real!
+#define MAG_IGNORE 50                   // Ignore magnitudes fainter than this --- they're not real!
 #define FAKE_SIZE 1                     // Size of fake convolution kernel
+#define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \
+                     PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
 
 //#define TESTING
@@ -84,5 +86,5 @@
         for (int i = 0; i < sources->n; i++) {
             pmSource *source = sources->data[i]; // Source of interest
-            if (source->psfMag > maxMag && source->psfMag != MAG_IGNORE) {
+            if (source->psfMag > maxMag && source->psfMag <= MAG_IGNORE && !(source->mode & SOURCE_MASK)) {
                 maxMag = source->psfMag;
             }
