Index: trunk/Mars/mcore/fits.h
===================================================================
--- trunk/Mars/mcore/fits.h	(revision 16888)
+++ trunk/Mars/mcore/fits.h	(revision 16889)
@@ -71,9 +71,9 @@
     //I know I know, you're going to yiell that this does not belong here.
     //It will belong in the global scope eventually, and it makes the coding of zfits much simpler this way.
-    typedef enum
-    {
-        UNKNOWN,
-        FACT
-    } FitsCompression;
+    enum Compression_t
+    {
+        kCompUnknown,
+        kCompFACT
+    };
 
     struct Entry
@@ -116,5 +116,5 @@
             char   type;
             string unit;
-            FitsCompression comp;
+            Compression_t comp;
         };
 
@@ -199,4 +199,5 @@
                 string com;
                 string val = Trim(vec[i].substr(10));
+
                 if (val[0]=='\'')
                 {
@@ -216,14 +217,8 @@
 
                     // Set value, comment and type
-                    if (ppp==string::npos)
-                        com = "";
-                    else
-                    {// comments could be just spaces. take care of this.
-                        if (val.size() == ppp+1)
-                            com = "";
-                        else
-                            com = Trim(val.substr(ppp+1));
-                    }
-//                    com  = ppp==string::npos ? "" : Trim(val.substr(ppp+1));
+                    // comments could be just spaces. take care of this.
+                    if (ppp!=string::npos && val.size() != ppp+1)
+                        com = Trim(val.substr(ppp+1));
+
                     val  = Trim(val.substr(1, p-2));
                     type = 'T';
@@ -233,8 +228,7 @@
                     const size_t p = val.find_first_of('/');
 
-                    if (val.size() == p+1)
-                        com = "";
-                    else
+                    if (val.size() != p+1)
                         com = Trim(val.substr(p+2));
+
                     val = Trim(val.substr(0, p));
 
@@ -246,4 +240,5 @@
 
                 const Entry e = { type, val, com, vec[i] };
+
                 rc[key] = e;
             }
@@ -253,6 +248,6 @@
 
         Table() : offset(0) { }
-        Table(const vector<string> &vec, off_t off) :
-            offset(off), isCompressed(false), keys(ParseBlock(vec))
+        Table(const vector<string> &vec, off_t off) : offset(off),
+            isCompressed(false), keys(ParseBlock(vec))
         {
             if (HasKey("ZTABLE") && Check("ZTABLE", 'B', "T"))
@@ -289,5 +284,6 @@
 
             size_t bytes = 0;
-            string tFormName = isCompressed ? "ZFORM" : "TFORM";
+
+            const string tFormName = isCompressed ? "ZFORM" : "TFORM";
             for (size_t i=1; i<=num_cols; i++)
             {
@@ -304,7 +300,7 @@
                 const string comp = Get<string>("ZCTYP"+num.str(), "");
 
-                FitsCompression compress = UNKNOWN;
+                Compression_t compress = kCompUnknown;
                 if (comp == "FACT")
-                    compress = FACT;
+                    compress = kCompFACT;
 
                 istringstream sin(fmt);
@@ -664,5 +660,5 @@
                 }
 
-                //Check for table name. Skip until eof or requested table are found.
+                // Check for table name. Skip until eof or requested table are found.
                 // skip the current table?
                 if (!tableName.empty() && tableName!=fTable.Get<string>("EXTNAME"))
@@ -676,6 +672,4 @@
                 }
 
-                //fTable.PrintKeys();
-
                 fBufferRow.resize(fTable.bytes_per_row + 8-fTable.bytes_per_row%4);
                 fBufferDat.resize(fTable.bytes_per_row);
