Index: /trunk/FACT++/src/Fits.cc
===================================================================
--- /trunk/FACT++/src/Fits.cc	(revision 12442)
+++ /trunk/FACT++/src/Fits.cc	(revision 12443)
@@ -68,10 +68,24 @@
     {//services have one (or two) more description than columns. skip the first entry while copying as it describes the table itself.
         fDataColDesc.clear();
+        fTableDesc = desc[0].comment;
+        if (fTableDesc.size() > 68)
+        {
+            out->Warn("Table description \"" + fTableDesc + "\" too long. truncating it (68 char max.)");
+            fTableDesc = fTableDesc.substr(0,68);
+        }
         for (unsigned int i=0;i<dataFormat.size(); i++)
         {
             string name = desc[i+1].name;
-            if (name.length() > 68) name = name.substr(0, 68);
+            if (name.length() > 68)
+            {
+                out->Warn("Column name " + name + "too long. truncating it (68 char max.)");
+                name = name.substr(0, 68);
+            }
             string comment = desc[i+1].comment;
-            if (comment.length() > 68) comment = comment.substr(0,68);
+            if ((comment.length() + name.length()) > 71)
+            {
+                out->Warn("Column " + name + " added to \"" + comment + "\" too long. truncating to fit 68 chars.");
+                comment = comment.substr(0,68);
+            }
             string unit = desc[i+1].unit;
             if (unit.length() > 68)  unit = comment.substr(0,68);
@@ -170,5 +184,34 @@
 
         fCopyBuffer.resize(fFile->GetDataSize());
-
+//write header comments
+        ostringstream str;
+        for (unsigned int i=0;i<fStandardColDesc.size();i++)
+        {
+            str.str("");
+            str << "TTYPE" << i+1;
+            fFile->WriteKeyNT(str.str(), fStandardColDesc[i].name, fStandardColDesc[i].comment);
+            str.str("");
+            str << "TCOMM" << i+1;
+            fFile->WriteKeyNT(str.str(), fStandardColDesc[i].comment, "");
+        }
+
+        for (unsigned int i=0; i<fDataColDesc.size(); i++)
+        {
+            string name = fDataColDesc[i].name;
+            if (name.empty())
+            {
+                ostringstream stt;
+                stt << "Data" << i;
+                name = stt.str();
+            }
+            str.str("");
+            str << "TTYPE" << i+fStandardColDesc.size()+1;
+            fFile->WriteKeyNT(str.str(), name, fDataColDesc[i].comment);
+            str.str("");
+            str << "TCOMM" << i+fStandardColDesc.size()+1;
+            fFile->WriteKeyNT(str.str(), fDataColDesc[i].comment, "");
+        }
+        fFile->WriteKeyNT("COMMENT", fTableDesc, "");
+        //END COMMENTS UPDATE
         return fFile->GetNumRows()==0 ? true : WriteHeaderKeys();
     }
Index: /trunk/FACT++/src/Fits.h
===================================================================
--- /trunk/FACT++/src/Fits.h	(revision 12442)
+++ /trunk/FACT++/src/Fits.h	(revision 12443)
@@ -33,4 +33,6 @@
     ///the vector of data column names
     vector<Description> fDataColDesc;
+    //Description of the table
+    string fTableDesc;
     ///the data format of the data columns
     vector<string> fDataFormats;
Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 12442)
+++ /trunk/FACT++/src/datalogger.cc	(revision 12443)
@@ -806,10 +806,10 @@
 
      fOpenedNightlyFiles = new DimDescribedService(GetName() + "/FILENAME_NIGHTLY", "I:1;C", fToDim,
-                               "Path and base name which is used to compile the filenames for the nightly files."
+                               "Path and base name used for the nightly files."
                                "|Type[int]:type of open files (1=log, 2=rep, 4=fits)"
                                "|Name[string]:path and base file name");
 
      fOpenedRunFiles = new DimDescribedService(GetName() + "/FILENAME_RUN", "I:1;C", fToDim,
-                               "Path and base name which is used to compile the filenames for the run files."
+                               "Path and base name used for the run files."
                                "|Type[int]:type of open files (1=log, 2=rep, 4=fits)"
                                "|Name[string]:path and base file name");
@@ -818,6 +818,6 @@
      fNumSubAndFitsData.numOpenFits = 0;
      fNumSubAndFits = new DimDescribedService(GetName() + "/NUM_SUBS", "I:2", fNumSubAndFitsData,
-                               "Shows number of services to which the data logger is currently subscribed and the total number of open files."
-                               "|NumSubAndNumOpenFiles[int]:number of dim services to which the data logger is currently subscribed plus number of files currently open by the data logger");
+                               "Num. open files + num. subscribed services"
+                               "|NSubAndOpenFiles[int]:Num. of subs and open files");
 
      //services parameters
@@ -955,8 +955,11 @@
 void DataLogger::infoHandler()
 {
-    if (!fAutoStarted && fShouldAutoStart)
+    if ((GetCurrentState() == kSM_Ready) &&  (!fAutoStarted) && fShouldAutoStart)
     {
         fAutoStarted = true;
         SetCurrentState(StartPlease());
+    }
+    else {if (GetCurrentState() > kSM_Ready)
+            fAutoStarted = true;
     }
     DimInfo* I = getInfo();
