Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 4817)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 4826)
@@ -233,5 +233,5 @@
         name += branch->GetName();
 
-        *fLog << " " << name.Strip(TString::kTrailing, '.') << ": \t" << branch->GetEntries() << " entries." << endl;
+        *fLog << " " << name.Strip(TString::kTrailing, '.') << ": \t" << (ULong_t)branch->GetEntries() << " entries." << endl;
     }
 
@@ -240,5 +240,5 @@
     while ((t=(TTree*)NextTree()))
         if (t->TestBit(kIsNewTree))
-            *fLog << " " << t->GetName() << ": \t" << t->GetEntries() << " entries." << endl;
+            *fLog << " " << t->GetName() << ": \t" << (ULong_t)t->GetEntries() << " entries." << endl;
     *fLog << endl;
 }
@@ -257,4 +257,13 @@
 void MWriteRootFile::AddContainer(const char *cname, const char *tname, Bool_t must)
 {
+    TIter Next(&fBranches);
+    TObject *o=0;
+    while ((o=Next()))
+        if (TString(o->GetName())==TString(tname) && TString(o->GetTitle())==TString(cname))
+        {
+            *fLog << "WARNING - Container '" << cname << "' in Tree '" << tname << "' already scheduled... ignored." << endl;
+            return;
+        }
+
     //
     // create a new entry in the list of branches to write and
@@ -281,4 +290,14 @@
                                   Bool_t must)
 {
+    TIter Next(&fBranches);
+    TObject *o=0;
+    while ((o=Next()))
+        if (TString(o->GetName())==TString(tname) &&
+            static_cast<MRootFileBranch*>(o)->GetContainer()==cont)
+        {
+            *fLog << "WARNING - Container " << cont << " in Tree '" << tname << "' already scheduled... ignored." << endl;
+            return;
+        }
+
     //
     // create a new entry in the list of branches to write and
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 4817)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 4826)
@@ -23,5 +23,4 @@
 
     MParContainer *fContainer;
-    TString        fContName;
 
     Bool_t         fMust;
@@ -37,5 +36,5 @@
     {
         Init(NULL, kFALSE);
-        fContName = "";
+        fTitle = "";
     }
 
@@ -44,11 +43,12 @@
     {
         Init(tname, must);
-        fContName = cname;
+        fTitle = cname;
     }
 
     MRootFileBranch(MParContainer *cont, const char *tname=NULL, Bool_t must=kFALSE)
-        : fTree(NULL), fBranch(NULL), fContName(""), fMust(0)
+        : fTree(NULL), fBranch(NULL), fMust(0)
     {
         Init(tname, must);
+        fTitle = "";
         fContainer = cont;
     }
@@ -58,5 +58,5 @@
     void          *GetAddress()         { return &fContainer; }
     TBranch       *GetBranch() const    { return fBranch; }
-    const char    *GetContName() const  { return fContName; }
+    const char    *GetContName() const  { return fTitle; }
     Bool_t         MustHave() const     { return fMust; }
 
