Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 27152)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 27155)
@@ -18,29 +18,27 @@
     psString summary = NULL;        // Summary of images
     for (int i = 0; i < options->num; i++) {
-        char *reason;               // Reason for rejecting
-        switch (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
-          case PPSTACK_MASK_NONE:
-            reason = "Good";
+        psString reason = NULL;         // Reason for rejecting
+        if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) {
+            psStringAppend(&reason, " Good.");
             numGood++;
-            break;
-          case PPSTACK_MASK_CAL:
-            reason = "Calibration failed";
-            break;
-          case PPSTACK_MASK_PSF:
-            reason = "PSF measurement failed";
-            break;
-          case PPSTACK_MASK_MATCH:
-            reason = "PSF matching failed";
-            break;
-          case PPSTACK_MASK_CHI2:
-            reason = "PSF matching chi^2 deviant";
-            break;
-          case PPSTACK_MASK_REJECT:
-            reason = "Rejection exceeded threshold";
-            break;
-          default:
-            psAbort("Unrecognised mask value: %x", options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]);
+        } else {
+            if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_CAL) {
+                psStringAppend(&reason, " Calibration failed.");
+            }
+            if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_PSF) {
+                psStringAppend(&reason, " PSF measurement failed.");
+            }
+            if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_MATCH) {
+                psStringAppend(&reason, " PSF matching failed.");
+            }
+            if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_CHI2) {
+                psStringAppend(&reason, " PSF matching chi^2 deviant.");
+            }
+            if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_REJECT) {
+                psStringAppend(&reason, " Rejection exceeded threshold.");
+            }
         }
         psStringAppend(&summary, "Image %d: %s\n", i, reason);
+        psFree(reason);
     }
     psLogMsg("ppStack", PS_LOG_INFO, "Summary of images for %s:\n%s", place, summary);
