Index: trunk/FACT++/src/Fits.cc
===================================================================
--- trunk/FACT++/src/Fits.cc	(revision 12638)
+++ trunk/FACT++/src/Fits.cc	(revision 12639)
@@ -316,16 +316,16 @@
     }
 
+    const double tm = *reinterpret_cast<double*>(fStandardPointers[0]);
+
     //the first standard variable is the current MjD
     if (fEndMjD==0)
     {
         // FIXME: Check error?
-        const double time = *reinterpret_cast<double*>(fStandardPointers[0]);
-
-        fFile->WriteKeyNT("TSTARTI", uint32_t(floor(time)),    "Time when first event received (integral part)");
-        fFile->WriteKeyNT("TSTARTF", fmod(time, 1),            "Time when first event received (fractional part)");
+        fFile->WriteKeyNT("TSTARTI", uint32_t(floor(tm)),      "Time when first event received (integral part)");
+        fFile->WriteKeyNT("TSTARTF", fmod(tm, 1),              "Time when first event received (fractional part)");
         fFile->WriteKeyNT("TSTOPI",  uint32_t(floor(fEndMjD)), "Time when last event received (integral part)");
         fFile->WriteKeyNT("TSTOPF",  fmod(fEndMjD, 1),         "Time when last event received (fractional part)");
 
-        fFile->WriteKeyNT("DATE-OBS", Time(time+40587).Iso(),
+        fFile->WriteKeyNT("DATE-OBS", Time(tm+40587).Iso(),
                           "Time when first event received");
 
@@ -333,5 +333,6 @@
                           "Time when last event received");
     }
-    fEndMjD = time;
+
+    fEndMjD = tm;
 
     return true;
