Index: trunk/ppMerge/src/ppMergeArguments.c
===================================================================
--- trunk/ppMerge/src/ppMergeArguments.c	(revision 18111)
+++ trunk/ppMerge/src/ppMergeArguments.c	(revision 18112)
@@ -185,27 +185,44 @@
     const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Type of calibration
     if (strlen(typeStr) <= 0) {
-        psError(PS_ERR_UNKNOWN, false, "No -type specified.");
-        goto ERROR;
+      psError(PS_ERR_UNKNOWN, false, "No -type specified.");
+      goto ERROR;
     }
     ppMergeType type = PPMERGE_TYPE_UNKNOWN; // Enumerated type for frame type
     if (strcasecmp(typeStr, "BIAS") == 0) {
-        type = PPMERGE_TYPE_BIAS;
-    } else if (strcasecmp(typeStr, "DARK") == 0) {
-        type = PPMERGE_TYPE_DARK;
-    } else if (strcasecmp(typeStr, "FLAT") == 0 || strcasecmp(typeStr, "SKYFLAT") == 0 ||
-               strcasecmp(typeStr, "DOMEFLAT") == 0) {
-        type = PPMERGE_TYPE_FLAT;
-    } else if (strcasecmp(typeStr, "FRINGE") == 0) {
-        type = PPMERGE_TYPE_FRINGE;
-    } else if (strcasecmp(typeStr, "SHUTTER") == 0) {
-        type = PPMERGE_TYPE_SHUTTER;
-    } else if (strcasecmp(typeStr, "MASK") == 0 ||
-               strcasecmp(typeStr, "DARKMASK") == 0 ||
-               strcasecmp(typeStr, "FLATMASK") == 0) {
-        type = PPMERGE_TYPE_MASK;
-    } else {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised image type: %s", typeStr);
-        goto ERROR;
-    }
+      type = PPMERGE_TYPE_BIAS;
+      goto VALID;
+    } 
+    if (strcasecmp(typeStr, "DARK") == 0 ||
+	strcasecmp(typeStr, "DARK_PREMASK") == 0) {
+      type = PPMERGE_TYPE_DARK;
+      goto VALID;
+    } 
+    if (strcasecmp(typeStr, "FLAT") == 0 || 
+	strcasecmp(typeStr, "DOMEFLAT") == 0 ||
+	strcasecmp(typeStr, "SKYFLAT") == 0 ||
+	strcasecmp(typeStr, "FLAT_PREMASK") == 0 ||
+	strcasecmp(typeStr, "SKYFLAT_PREMASK") == 0 ||
+	strcasecmp(typeStr, "DOMEFLAT_PREMASK") == 0) {
+      type = PPMERGE_TYPE_FLAT;
+      goto VALID;
+    } 
+    if (strcasecmp(typeStr, "FRINGE") == 0) {
+      type = PPMERGE_TYPE_FRINGE;
+      goto VALID;
+    } 
+    if (strcasecmp(typeStr, "SHUTTER") == 0) {
+      type = PPMERGE_TYPE_SHUTTER;
+      goto VALID;
+    } 
+    if (strcasecmp(typeStr, "MASK") == 0 ||
+	strcasecmp(typeStr, "DARKMASK") == 0 ||
+	strcasecmp(typeStr, "FLATMASK") == 0) {
+      type = PPMERGE_TYPE_MASK;
+      goto VALID;
+    } 
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unrecognised image type: %s", typeStr);
+    goto ERROR;
+
+ VALID:
     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "TYPE", 0, "Type of calibration frame", type);
 
