Index: /branches/eam_branches/ohana.20150429/src/libfits/extern/gzip.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/extern/gzip.c	(revision 38338)
+++ /branches/eam_branches/ohana.20150429/src/libfits/extern/gzip.c	(revision 38339)
@@ -200,6 +200,7 @@
   }
 
-  // the '5' is the compression level: make this a user argument
-  err = deflateInit(&stream, 5);
+  // the '1' is the compression level: make this a user argument
+  // NOTE: cfitsio uses a fixed value of 1
+  err = deflateInit(&stream, 1);
   if (0) fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", stream.avail_in, stream.avail_out, (int) stream.total_out);
 
Index: /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_utils.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_utils.c	(revision 38338)
+++ /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_utils.c	(revision 38339)
@@ -166,5 +166,5 @@
   int i, Nbyte;
 
-  if (!strcasecmp(cmptype, "GZIP_1")) {
+  if (!strcasecmp(cmptype, "GZIP_1") || !strcasecmp(cmptype, "NONE")) {
     if (out_bitpix == 8)  return (1);
     if (out_bitpix == 16) return (2);
Index: /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_M.c
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_M.c	(revision 38338)
+++ /branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_M.c	(revision 38339)
@@ -261,5 +261,5 @@
 
     zdata = gfits_varlength_column_pointer (ftable, &zdef, row, &Nzdata);
-    if (!zdata) return (FALSE);
+    if (!zdata) ESCAPE;
 
     // XXX not certain this is the correct place to do the swap (or if zdata_pixsize is
@@ -267,13 +267,13 @@
 
     if (strcasecmp(cmptype, "GZIP_1")) {
-      if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE);
+      if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) ESCAPE;
     }
 
     // gfits_uncompress_data uncompresses from zdata to the temporary output buffer which must be allocated
     // XXX the tile must not be > 2GB
-    if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) return (FALSE);
+    if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) ESCAPE;
 
     // copy the uncompressed pixels into their correct locations 	    
-    if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, oblank, ztile, zblank, zscale, zzero)) return (FALSE);
+    if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, oblank, ztile, zblank, zscale, zzero)) ESCAPE;
 
     // update the tile counters, carrying to the next dimension if needed
@@ -287,4 +287,17 @@
     }
   }
+
+  FREE (ztile);
+  if (optname != NULL) {
+    for (j = 0; j < Noptions; j++) {
+      FREE (optname[j]);
+      FREE (optvalue[j]);
+    }
+    FREE (optname);
+    FREE (optvalue);
+  }
+  FREE (out);
+  FREE (otile); 
+  FREE (ntile); 
   return (TRUE);
 }
Index: /branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
===================================================================
--- /branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh	(revision 38338)
+++ /branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh	(revision 38339)
@@ -1,4 +1,4 @@
 
-macro go
+macro test1
  mcreate z 500 500
  set x = xramp(z)
@@ -8,8 +8,20 @@
  set d = x - b
  stat d
+ exec fpack -g -S test.raw.fits > test.fpk.fits
  exec funpack -S test.cmp.fits > test.fun.fits
 end
 
-macro ttest
+macro test2
+ mcreate z 500 500
+ set x = xramp(z)
+ wd x test.raw.fits -bitpix -32 -bzero 0 -bscale 1
+ wd x test.cmp.fits -bitpix -32 -bzero 0 -bscale 1 -compress -compress-mode NONE
+ rd b test.cmp.fits -x 0
+ set d = x - b
+ stat d
+ # exec funpack -S test.cmp.fits > test.fun.fits
+end
+
+macro test3
 
  create x 0 100
