Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2470)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 2529)
@@ -409,5 +409,9 @@
     // Check whether this branch really exists
     //
-    if (fChain->GetBranch(name))
+    TString bn(name);
+    if (bn.EndsWith("*"))
+        bn.Remove(bn.Length()-1);
+
+    if (fChain->GetBranch(bn))
         SetBranchStatus(name, status);
 
@@ -905,4 +909,9 @@
 }
 
+TString MReadTree::GetTreeName() const
+{
+    return fChain->GetName();
+}
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 2470)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 2529)
@@ -161,5 +161,5 @@
         MRootFileBranch *b = (MRootFileBranch*)obj;
 
-        if (b->GetTree()->TestBit(kIsNewTree))
+        if (!b->GetTree() || b->GetTree()->TestBit(kIsNewTree))
             continue;
 
