Index: branches/tap_branches/pswarp/src/pswarpSetMaskBits.c
===================================================================
--- branches/tap_branches/pswarp/src/pswarpSetMaskBits.c	(revision 25900)
+++ branches/tap_branches/pswarp/src/pswarpSetMaskBits.c	(revision 27838)
@@ -28,5 +28,5 @@
     // this function sets the required single-image mask bits
     if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) {
-        psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");
+        psError (psErrorCodeLast(), false, "Unable to define the mask bit values");
         return false;
     }
@@ -48,4 +48,7 @@
     maskOut |= poorMask;
 
+    // the output image includes all of the bits from the input image
+    maskOut |= maskIn;
+
     // search for an unset bit to use for MARK:
     psImageMaskType markOut   = 0x00;
@@ -61,5 +64,5 @@
     }
     if (!markOut) {
-        psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");
+        psError(PSWARP_ERR_CONFIG, true, "Unable to define the MARK bit mask: all bits taken!");
         return false;
     }
@@ -68,5 +71,5 @@
     psMetadata *warpRecipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
     if (!warpRecipe) {
-        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
+        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
         return false;
     }
@@ -82,5 +85,5 @@
     psMetadata *psphotRecipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
     if (!psphotRecipe) {
-        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE);
+        psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE);
         return false;
     }
