Index: /trunk/Mars/mcore/zfits.h
===================================================================
--- /trunk/Mars/mcore/zfits.h	(revision 17304)
+++ /trunk/Mars/mcore/zfits.h	(revision 17305)
@@ -20,18 +20,18 @@
     // Basic constructor
     zfits(const std::string& fname, const std::string& tableName="", bool force=false)
-        : fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
+        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
     {
         open(fname.c_str());
         Constructor(fname, "", tableName, force);
-        InitCompressionReading();
+//        InitCompressionReading();
     }
 
     // Alternative contstructor
     zfits(const std::string& fname, const std::string& fout, const std::string& tableName, bool force=false)
-        : fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
+        : fCatalogInitialized(false), fNumTiles(0), fNumRowsPerTile(0), fCurrentRow(-1), fHeapOff(0), fTileSize(0)
     {
         open(fname.c_str());
         Constructor(fname, fout, tableName, force);
-        InitCompressionReading();
+//        InitCompressionReading();
     }
 
@@ -94,4 +94,6 @@
     void InitCompressionReading()
     {
+        fCatalogInitialized = true;
+
         if (!fTable.is_compressed)
             return;
@@ -143,4 +145,6 @@
         memcpy(dest, src, c.num*c.size);
     }
+
+    bool  fCatalogInitialized;
 
     std::vector<char> fBuffer;           ///<store the uncompressed rows
@@ -278,4 +282,7 @@
             return false;
 
+        if (!fCatalogInitialized)
+            InitCompressionReading();
+
         const uint32_t requestedTile = rowNum/fNumRowsPerTile;
         const uint32_t currentTile   = fCurrentRow/fNumRowsPerTile;
