Index: /trunk/FACT++/src/Fits.cc
===================================================================
--- /trunk/FACT++/src/Fits.cc	(revision 12418)
+++ /trunk/FACT++/src/Fits.cc	(revision 12419)
@@ -215,4 +215,5 @@
         corruptName << fFileName << "corrupt" << append;
     }
+    this->fFile->Close();
     if (rename(fFileName.c_str(), corruptName.str().c_str()) != 0)
     {
Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 12418)
+++ /trunk/FACT++/src/datalogger.cc	(revision 12419)
@@ -1865,5 +1865,5 @@
             if (!sub.nightlyFile.Write(*sub.fConv.get()))
             {
-                sub.nightlyFile.Close();
+                //sub.nightlyFile.Close();
                 RemoveService(sub.server, sub.service, false);
                 GoToNightlyWriteErrorState();
