Index: trunk/MagicSoft/Mars/mastro/MAstro.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 9313)
+++ trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 9314)
@@ -338,5 +338,5 @@
 // --------------------------------------------------------------------------
 //
-// Convert a mjd to a number yymmdd. The century is just cuts away, e.g.
+// Convert a mjd to a number yymmdd. The century is just cut away, e.g.
 //   54393 -->  71020   (2007/10/20)
 //   50741 --> 971020   (1997/10/20)
@@ -355,5 +355,5 @@
 //
 // Convert a yymmdd number to mjd. The century is defined as 2000 for
-// yy<70, 1900 elsewise.
+// yy<70, 1900 otherwise.
 //    71020 --> 54393 (2007/10/20)
 //   971020 --> 50741 (1997/10/20)
Index: trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 9313)
+++ trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 9314)
@@ -60,4 +60,5 @@
 
 #include "MArgs.h"
+#include "MString.h"
 
 ClassImp(MEnv);
@@ -541,5 +542,5 @@
 
     if (style>3999 && style<4101)
-        val = Form("%d%%", style-4000);
+        val = MString::Format("%d%%", style-4000);
 
     switch (style)
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 9313)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 9314)
@@ -233,6 +233,5 @@
     // This does not reset the counter!
     fStopwatch->Reset();
-    fNumExecutions = 0;
-    fNumExec0 = GetNumExecutionsTotal();
+    fNumExec0 = fNumExecutions;
 
     *fLog << all << GetDescriptor() << "... " << flush;
@@ -400,15 +399,15 @@
 UInt_t MTask::GetNumExecutions() const
 {
-    return GetNumExecutionsTotal()-fNumExec0;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Return the total number of calls to Process(). If Process() was not
+    return fNumExecutions-fNumExec0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Return the total number of calls to Process() ever. If Process() was not
 //  called due to a set filter this is not counted.
 //
 UInt_t MTask::GetNumExecutionsTotal() const
 {
-    return fNumExecutions-1;
+    return fNumExecutions;
 }
 
@@ -467,5 +466,5 @@
     *fLog << GetDescriptor();
 
-    if (GetNumExecutions()!=(UInt_t)-1)
+    if (GetNumExecutions()>0)
         *fLog << "\t" << dec << GetNumExecutions();
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationPatternDecode.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationPatternDecode.cc	(revision 9313)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationPatternDecode.cc	(revision 9314)
@@ -34,4 +34,5 @@
 // Input:
 //   MRawEvtData
+//   MRawRunHeader
 //
 // Output:
@@ -68,5 +69,5 @@
 Int_t MCalibrationPatternDecode::PreProcess(MParList *pList)
 {
-    fRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader");
+    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     if (!fRunHeader)
     {
@@ -84,8 +85,5 @@
     fPattern = (MCalibrationPattern*)pList->FindCreateObj("MCalibrationPattern");
     if (!fPattern)
-    {
-	*fLog << err << "MCalibratinPattern not found... abort." << endl;
 	return kFALSE;
-    }
 
     return kTRUE;
@@ -102,76 +100,88 @@
     // been called just before
     if (fRunHeader->GetFormatVersion()<5)
-      return kTRUE;
+        return kTRUE;
 
-    UInt_t pattern = fEvtHeader->GetCalibrationPattern();
+    // Get calibration pattern from event header
+    const UInt_t pattern = fEvtHeader->GetCalibrationPattern();
 
-    fPattern->fCLStrength = pattern & 0xff;
-    fPattern->fCLColor    = (MCalibrationPattern::CLColor_t)((pattern>>8)&0xf);
-    
-    const UInt_t pulserpattern = (pattern >> 16) & 0xffff;
+    const UInt_t str = (pattern    ) & 0x00ff;
+    const UInt_t col = (pattern>> 8) & 0x000f;
+    const UInt_t pat = (pattern>>16) & 0xffff;
 
-    fPattern->fPulserColor =  MCalibrationCam::kNONE;    
+    fPattern->fCLStrength = str;
+    fPattern->fCLColor    = (MCalibrationPattern::CLColor_t)col;
 
-    if ((pulserpattern & kGreenAndBlue) || (pulserpattern & kBlueAndUV) || (pulserpattern & kGreenAndUV))
-      fPattern->fPulserColor =  MCalibrationCam::kNONE;
-    if (pulserpattern & kCT1Pulser)
-      fPattern->fPulserColor =  MCalibrationCam::kCT1;
-    if (pulserpattern & kAnyUV)
-      fPattern->fPulserColor =  MCalibrationCam::kUV;
-    if (pulserpattern & kAnyGreen)
-      fPattern->fPulserColor =  MCalibrationCam::kGREEN;
-    if (pulserpattern & kAnyBlue)
-      fPattern->fPulserColor =  MCalibrationCam::kBLUE;
+    // Set a default pattern
+    fPattern->fPulserColor =  MCalibrationCam::kNONE;
 
-    Float_t strength = 0.;
+    // Check the pattern
+    if ((pat & kGreenAndBlue) || (pat & kBlueAndUV) || (pat & kGreenAndUV))
+        fPattern->fPulserColor =  MCalibrationCam::kNONE;
+
+    if (pat & kCT1Pulser)
+        fPattern->fPulserColor =  MCalibrationCam::kCT1;
+
+    if (pat & kAnyUV)
+        fPattern->fPulserColor =  MCalibrationCam::kUV;
+
+    if (pat & kAnyGreen)
+        fPattern->fPulserColor =  MCalibrationCam::kGREEN;
+
+    if (pat & kAnyBlue)
+        fPattern->fPulserColor =  MCalibrationCam::kBLUE;
+
+    // Now decode the strength
+    fPattern->fPulserStrength = 0.;
 
     switch (fPattern->fPulserColor)
-      {
+    {
       case MCalibrationCam::kNONE:
-	break;
+          break;
+
       case MCalibrationCam::kGREEN:
-        if (pulserpattern & kSlot1Green)
-          strength += 5.;
-        if (pulserpattern & kSlot2Green)
-          strength += 2.;
-        if (pulserpattern & kSlot15Green)
-          strength += 1.;
-        if (pulserpattern & kSlot16AttGreen)
-          strength += 0.2;
-	break;      
+          if (pat & kSlot1Green)
+              fPattern->fPulserStrength += 5.0;
+          if (pat & kSlot2Green)
+              fPattern->fPulserStrength += 2.0;
+          if (pat & kSlot15Green)
+              fPattern->fPulserStrength += 1.0;
+          if (pat & kSlot16AttGreen)
+              fPattern->fPulserStrength += 0.2;
+          break;
+
       case MCalibrationCam::kBLUE:
-        if (pulserpattern & kSlot3Blue)
-          strength += 5.1;
-        if (pulserpattern & kSlot6Blue)
-          strength += 5.2;
-        if (pulserpattern & kSlot7Blue)
-          strength += 5.4;
-        if (pulserpattern & kSlot8Blue)
-          strength += 2.;
-        if (pulserpattern & kSlot9AttBlue)
-          strength += 0.25;
-        if (pulserpattern & kSlot10Blue)
-          strength += 0.;
-        if (pulserpattern & kSlot11Blue)
-          strength += 1.;
-        if (pulserpattern & kSlot14Blue)
-          strength += 5.8;
-	break;      
+          if (pat & kSlot3Blue)
+              fPattern->fPulserStrength += 5.1;
+          if (pat & kSlot6Blue)
+              fPattern->fPulserStrength += 5.2;
+          if (pat & kSlot7Blue)
+              fPattern->fPulserStrength += 5.4;
+          if (pat & kSlot8Blue)
+              fPattern->fPulserStrength += 2.0;
+          if (pat & kSlot9AttBlue)
+              fPattern->fPulserStrength += 0.25;
+          if (pat & kSlot10Blue)
+              fPattern->fPulserStrength += 0.0;
+          if (pat & kSlot11Blue)
+              fPattern->fPulserStrength += 1.0;
+          if (pat & kSlot14Blue)
+              fPattern->fPulserStrength += 5.8;
+          break;
+
       case MCalibrationCam::kUV:
-        if (pulserpattern & kSlot4UV)
-          strength += 1.;
-        if (pulserpattern & kSlot5UV)
-          strength += 2.;
-        if (pulserpattern & kSlot12UV)
-          strength += 5.1;
-        if (pulserpattern & kSlot13UV)
-          strength += 5.2;
-	break;      
+          if (pat & kSlot4UV)
+              fPattern->fPulserStrength += 1.0;
+          if (pat & kSlot5UV)
+              fPattern->fPulserStrength += 2.0;
+          if (pat & kSlot12UV)
+              fPattern->fPulserStrength += 5.1;
+          if (pat & kSlot13UV)
+              fPattern->fPulserStrength += 5.2;
+          break;
+
       case MCalibrationCam::kCT1:
-	strength = 20.;
-	break;      
-      }
-  
-    fPattern->fPulserStrength = strength;
+          fPattern->fPulserStrength = 20.;
+          break;
+    }
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mcorsika/MCorsikaRead.cc
===================================================================
--- trunk/MagicSoft/Mars/mcorsika/MCorsikaRead.cc	(revision 9313)
+++ trunk/MagicSoft/Mars/mcorsika/MCorsikaRead.cc	(revision 9314)
@@ -218,4 +218,6 @@
         if (fDisplay)
         {
+            // Show the number of the last event after
+            // which we now open a new file
             TString txt = GetFileName();
             txt += " @ ";
