Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9314)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9315)
@@ -291,4 +291,5 @@
         // Delete the file. This'll also close the file (if open)
         //
+        *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl;
         delete fOut;
 
@@ -299,5 +300,4 @@
         // - Branches are automatically deleted by the tree destructor
         //
-        *fLog << inf << "Output File closed and object deleted." << endl;
     }
 
@@ -325,9 +325,5 @@
     *fLog << all << underline << "File: " << GetFileName() << dec << endl;
 
-    if (fTrees.GetEntries()==0)
-    {
-        *fLog << "  No contents." << endl;
-        return;
-    }
+    Bool_t cont = kFALSE;
 
     TObject *obj;
@@ -347,4 +343,5 @@
 
         *fLog << " + " << name.Strip(TString::kTrailing, '.') << ": \t" << (ULong_t)branch->GetEntries() << " entries." << endl;
+        cont = kTRUE;
     }
 
@@ -353,7 +350,11 @@
     while ((t=(TTree*)NextTree()))
         if (t->TestBit(kIsNewTree))
+        {
             *fLog << " + " << t->GetName() << ": \t" << (ULong_t)t->GetEntries() << " entries." << endl;
+            cont = kTRUE;
+        }
 
     TIter NextKey(fOut->GetList());
+    
     while ((obj=NextKey()))
     {
@@ -365,5 +366,10 @@
 
         *fLog << " - " << obj->GetName() << ": \t" << (ULong_t)((TTree*)obj)->GetEntries() << " entries." << endl;
-    }
+        cont = kTRUE;
+    }
+
+    if (!cont)
+        *fLog << "  No contents." << endl;
+
     *fLog << endl;
 }
@@ -822,6 +828,7 @@
 
     // Close/delete the old file (keys already written above)
+    *fLog << inf3 << "Closing file " << fOut->GetName() << "." << endl;
     delete fOut;
-
+ 
     // Replace current with new file
     fOut = newfile;
@@ -912,7 +919,18 @@
     *fLog << inf << out << flush;
 
-    TTree *clone=t.CloneTree();
-    clone->Write();
-    delete clone;
+    // When a new file has been opened the old clone (if existing) has
+    // been moved to the new file. We could now use CopyTree but then
+    // we would have to unpack all data and repack it. Instead
+    // we delete the moved old tree.
+    //  FIXME: In priciple we could delete a "wrong" tree with the same name.
+    //         Should we flag the clones and delete them in ChangeFile?
+    TObject *old = fOut->GetList()->Remove(fOut->GetList()->FindObject(t.GetName()));
+    delete old;
+
+    // Now we clone the tree without unpacking and repacking.
+    // When it has not been moved it will be deleted in the TFile destructor
+    /*TTree *clone =*/ t.CloneTree(-1, "fast");
+    //clone->Write();
+    //delete clone;
 
     *fLog << "done." << endl;
Index: trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc	(revision 9314)
+++ trunk/MagicSoft/Mars/mfilter/MFDeltaT.cc	(revision 9315)
@@ -119,5 +119,5 @@
     Int_t i=0;
 
-    if (GetNumExecutions()>0)
+    if (GetNumExecutions()>1)
     {
         if (*fTime-fLastTime>fUpperLimit)
Index: trunk/MagicSoft/Mars/mhbase/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 9314)
+++ trunk/MagicSoft/Mars/mhbase/MFillH.cc	(revision 9315)
@@ -566,6 +566,6 @@
 //        fCanvas->cd();
 
+    fH->SetNumExecutions(GetNumExecutions());
     const Int_t rc = fH->Fill(fParContainer, fWeight?fWeight->GetVal():1);
-    fH->SetNumExecutions(GetNumExecutions()+1);
 
 //    if (save && fCanvas)
Index: trunk/MagicSoft/Mars/mhbase/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 9314)
+++ trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 9315)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.44 2009-02-10 20:00:09 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.45 2009-02-11 12:08:23 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -1508,7 +1508,11 @@
 void MH::PrintSkipped(UInt_t n, const char *str)
 {
-    *fLog << " " << setw(7) << n << " (";
-    *fLog << MString::Format("%5.1f", 100.*n/GetNumExecutions());
-    *fLog << "%) Evts skipped: " << str << endl;
+    *fLog << " " << setw(7) << n;
+    if (GetNumExecutions()>0)
+    {
+        *fLog << " (" << MString::Format("%5.1f", 100.*n/GetNumExecutions());
+        *fLog << "%)" << str << endl;
+    }
+    *fLog << " Evts skipped: " << str << endl;
 }
 
