Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 8582)
@@ -151,6 +151,12 @@
     // file always. Which might make the usage outside of
     // callisto difficult.
+    TObjArray cont;
+    cont.Add(const_cast<TEnv*>(GetEnv()));
+
+    if (fDisplay)
+        cont.Add(fDisplay);
+
     const TString name(Form("signal%08d.root", fSequence.GetSequence()));
-    return WriteDisplay(name, "UPDATE");
+    return WriteContainer(cont, name, "UPDATE");
 }
 
@@ -675,4 +681,13 @@
     writemc.AddContainer("MMcEvtBasic", "OriginalMC");
 
+    // Write the special calib tree
+    /*
+    MWriteRootFile writecal(2, fname, fOverwrite?"RECREATE":"NEW");
+    writecal.SetName("WriteCalib");
+    writecal.AddContainer("MBadPixelsCam",          "Calib");
+    writecal.AddContainer("MCalibrationChargeCam",  "Calib");
+    writecal.AddContainer("MCalibrationRelTimeCam", "Calib");
+    */
+
     // Now setup tasklist for events
     MTaskList tlist2;
@@ -722,5 +737,7 @@
 	if (fIsRelTimesUpdate)
             tlist3.AddToList(&recalc); // MCalibrationRelTimeCam
-    }  
+
+        //tlist3.AddToList(&writecal);   // MWriteRootFile
+    }
 
     // Continue for all non-cosmic events
@@ -761,6 +778,9 @@
     //    tlist2.AddToList(&fill7);
     tlist2.AddToList(&fill9);
-    tlist2.AddToList(&fillB);
-    tlist2.AddToList(&fillD);
+    if (!fSequence.IsMonteCarlo())
+    {
+        tlist2.AddToList(&fillB);
+        tlist2.AddToList(&fillD);
+    }
     if (extractor1->HasLoGain())
     {
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 8582)
@@ -2027,4 +2027,6 @@
         cont.Add(fDisplay);
 
+    cont.Add(const_cast<TEnv*>(GetEnv()));
+
     return WriteContainer(cont, GetOutputFileName(), "UPDATE");
 }
Index: trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8582)
@@ -319,4 +319,6 @@
     if (fDisplay)
         arr.Add(fDisplay);
+
+    arr.Add(const_cast<TEnv*>(GetEnv()));
 
     return WriteContainer(arr, fname, "UPDATE");
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 8582)
@@ -895,5 +895,5 @@
         return kFALSE;
 
-    *fLog << all << "Mean pulse time (" << (fSequence.IsMonteCarlo()?"MC":"cosmics") << "): ";
+    *fLog << all << "Mean pulse time/Avg pos.of maximum (" << (fSequence.IsMonteCarlo()?"MC":"cosmics") << "): ";
     *fLog << meanpulsetime << "+-" << rmspulsetime << endl;
 
Index: trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8582)
@@ -1322,7 +1322,14 @@
 
     // check if output should be written
-    if (!fPathOut.IsNull())
-        fDisplay->SaveAsRoot(fPathOut);
-
-    return kTRUE;
-}
+    if (fPathOut.IsNull())
+        return kTRUE;
+
+    // Write the output
+    TObjArray cont;
+    cont.Add((TObject*)GetEnv());
+
+    if (fDisplay)
+        cont.Add(fDisplay);
+
+    return WriteContainer(cont, fPathOut, "RECREATE");
+}
Index: trunk/MagicSoft/Mars/mjobs/MJStar.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mjobs/MJStar.cc	(revision 8582)
@@ -103,19 +103,12 @@
     }
 
+    TObjArray cont;
+    cont.Add(const_cast<TEnv*>(GetEnv()));
+
+    if (fDisplay)
+        cont.Add(fDisplay);
+
     const TString oname = Form("%s/star%08d.root", (const char*)fPathOut, fSequence.GetSequence());
-
-    *fLog << inf << "Writing to file: " << oname << endl;
-
-    TFile file(oname, "RECREATE");
-
-    *fLog << inf << " - MStatusDisplay..." << flush;
-    if (fDisplay && fDisplay->Write()<=0)
-    {
-        *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
-        return kFALSE;
-    }
-    *fLog << inf << "ok." << endl;
-
-    return kTRUE;
+    return WriteContainer(cont, oname, "UPDATE");
 }
 
@@ -345,4 +338,5 @@
     // Spark cut
     MFDataPhrase fsparks("log10(MNewImagePar.fConc1) < (-0.371)*log10(MHillas.fSize) + 0.596", "SparkCut");
+    //fill0b.SetFilter(&fsparks);
     fill0c.SetFilter(&fsparks);
 
