Index: trunk/magic/remove/src/streaksio.c
===================================================================
--- trunk/magic/remove/src/streaksio.c	(revision 25082)
+++ trunk/magic/remove/src/streaksio.c	(revision 25209)
@@ -654,4 +654,15 @@
             streaksExit("", PS_EXIT_DATA_ERROR);
         }
+
+        // Ensure input is of the expected type
+        psDataType expected = isMask ? PS_TYPE_IMAGE_MASK : PS_TYPE_F32; // Expected type for image
+        for (int i = 0; i < in->imagecube->n; i++) {
+            psImage *image = in->imagecube->data[i]; // Image of interest
+            if (image->type.type != expected) {
+                psImage *temp = psImageCopy(NULL, image, expected);
+                psFree(image);
+                in->imagecube->data[i] = temp;
+            }
+        }
     }
     setDataExtent(stage, in, (stage == IPP_STAGE_RAW) && !isMask);
@@ -670,4 +681,5 @@
     sfile->fits->options = psFitsOptionsAlloc();
     sfile->fits->options->scaling = PS_FITS_SCALE_MANUAL;
+    sfile->fits->options->fuzz = false;
     sfile->fits->options->bitpix = bitpix;
     sfile->fits->options->bscale = bscale;
@@ -1114,12 +1126,12 @@
                 // these gets are not necessary, we could just set the pixels to nan
                 // but I want to get the counts
-                double imageVal  = psImageGet(image, x, y);
+                double imageVal  = image->data.F32[y][x];
                 psU32 maskVal;
                 if (sfiles->stage == IPP_STAGE_RAW) {
                     unsigned int xChip, yChip;
                     cellToChipInt(&xChip, &yChip, sfiles->astrom, x, y);
-                    maskVal = psImageGet(mask, xChip, yChip);
+                    maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip];
                 } else {
-                    maskVal = psImageGet(mask, x, y);
+                    maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x];
                 }
                 if (maskVal & maskMask) {
@@ -1127,11 +1139,11 @@
                     if (!isExciseValue(imageVal, sfiles->inImage->exciseValue)) {
                         ++nandPixels;
-                        psImageSet(image, x, y, exciseValue);
+                        image->data.F32[y][x] = exciseValue;
                     }
                     if (weight) {
-                        double weightVal = weight ? psImageGet(weight, x, y) : 0;
+                        double weightVal = weight ? weight->data.F32[y][x] : 0;
                         if (!isnan(weightVal)) {
                             ++nandWeights;
-                            psImageSet(weight, x, y, NAN);
+                            weight->data.F32[y][x] = NAN;
                         }
                     }
