Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6252)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6253)
@@ -129,5 +129,5 @@
    
    * mjobs/MJExtractCalibTest.[h,cc]
-     - remove
+     - removed
 
    * mjobs/MJCalibrateSignal.cc
Index: trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- trunk/MagicSoft/Mars/callisto.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/callisto.cc	(revision 6253)
@@ -379,8 +379,9 @@
             return 1;
         }
-        MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence()));
+
         if (kUseTest)
-          {
-            job4.SetBadPixels(job3.GetBadPixels());            
+        {
+            MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence()));
+            job4.SetBadPixels(job3.GetBadPixels());
             job4.SetSequence(seq);
             job4.SetEnv(kConfig);
@@ -390,18 +391,17 @@
             job4.SetPathOut(kOutpathC);
             job4.SetPathData(kInpathD);
-            //            job4.SetPathIn(kInpathC); 
 
             if (!job4.ProcessFile(job1.GetPedestalCam()))
-              {
+            {
                 gLog << err << "Calibration of calibration failed." << endl << endl;
                 return -1;
-              }
-            
+            }
+
             if (!job4.GetDisplay())
-              {
+            {
                 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
                 return 1;
-              }
-          }
+            }
+        }
     }
 
Index: trunk/MagicSoft/Mars/mbase/MFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MFilter.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/mbase/MFilter.cc	(revision 6253)
@@ -95,5 +95,5 @@
 TString MFilter::GetRule() const
 {
-    return "<GetRule n/a for " + fName + ">";
+    return ClassName(); //"<GetRule n/a for " + fName + ">";
 }
 
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 6253)
@@ -534,4 +534,18 @@
 MParContainer *MParContainer::GetNewObject(const char *name, TClass *base) const
 {
+    return base ? GetNewObject(name, base->GetName()) : 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// Return a new object of class 'name'. Make sure that the object
+// derives from the class base.
+//
+// In case of failure return NULL
+//
+// The caller is responsible of deleting the object!
+//
+MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
+{
     TClass *cls = GetConstructor(name);
     if (!cls || !base)
@@ -540,5 +554,7 @@
     if (!cls->InheritsFrom(base))
     {
-        *fLog << " - Class doesn't inherit from " << base->GetName() << endl;
+        *fLog << err;
+        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
+        *fLog << " - Class " << cls->GetName() << " doesn't inherit from " << base << endl;
         return NULL;
     }
@@ -550,40 +566,7 @@
     if (!obj)
     {
-        *fLog << " - Class has no default constructor." << endl;
-        *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
-        return NULL;
-    }
-
-    return (MParContainer*)obj;
-}
-
-// --------------------------------------------------------------------------
-//
-// Return a new object of class 'name'. Make sure that the object
-// derives from the class base.
-//
-// In case of failure return NULL
-//
-// The caller is responsible of deleting the object!
-//
-MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
-{
-    TClass *cls = GetConstructor(name);
-    if (!cls || !base)
-        return NULL;
-
-    if (!cls->InheritsFrom(base))
-    {
-        *fLog << " - Class doesn't inherit from " << base << endl;
-        return NULL;
-    }
-
-    //
-    // create the parameter container of the the given class type
-    //
-    TObject *obj = (TObject*)cls->New();
-    if (!obj)
-    {
-        *fLog << " - Class has no default constructor." << endl;
+        *fLog << err;
+        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
+        *fLog << " - Class " << cls->GetName() << " has no default constructor." << endl;
         *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
         return NULL;
@@ -766,5 +749,5 @@
         return kFALSE;
 
-    *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << ClassName() << "::ReadEnv." << endl;
+    *fLog << warn << "WARNING - " << fName << ": Resource " << prefix << " found, but no " << ClassName() << "::ReadEnv." << endl;
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- trunk/MagicSoft/Mars/merpp.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/merpp.cc	(revision 6253)
@@ -73,4 +73,5 @@
     gLog << " Options:" << endl;
     gLog.Usage();
+    gLog << "   --version, -V             Show startup message with version number" << endl;
     gLog << "   -?, -h, --help            This help" << endl << endl;
     gLog << " File Options:" << endl;
@@ -150,4 +151,7 @@
     //
     MArgs arg(argc, argv);
+
+    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+        return 0;
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
Index: trunk/MagicSoft/Mars/mfbase/MF.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/mfbase/MF.cc	(revision 6253)
@@ -172,7 +172,15 @@
     if (fg<0 && fl<0)
     {
-        *fLog << err << dbginf << "Syntax Error: No coditional sign found in " << txt << endl;
-        return NULL;
-    }
+        MFilter *f = (MFilter*)GetNewObject(txt, MFilter::Class());
+        if (!f)
+        {
+            *fLog << err << dbginf << "Syntax Error: '" << txt << "' is neither a MFilter nor conditional sign found." << endl;
+            return NULL;
+        }
+        // FIXME: Search object through list...?
+        txt = "";
+        return f;
+    }
+
     if (fg>=0 && fl>=0)
     {
@@ -199,5 +207,4 @@
 
     txt = "";
-
     return f;
 }
Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 6253)
@@ -376,5 +376,5 @@
     fLoGainFadcSamples = new MArrayB(numconnected*numlo);
 
-    fABFlags           = new MArrayB(maxid/8+1);
+    fABFlags           = new MArrayB(maxid==0 ? 0 : maxid/8+1);
 
     fConnectedPixels   = 0;
Index: trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc	(revision 6253)
@@ -73,5 +73,4 @@
 // return kTRUE  the lo gains exist for the actual pixel, else return kFALSE
 //
-#include <iostream>
 Bool_t MRawEvtPixelIter::HasLoGain() const
 {
@@ -85,43 +84,12 @@
         return kTRUE;
 
-//    cout << fNumLoGainEntry << " " << flush;
-//    cout << fData->fLoGainPixId->GetSize() << " " << flush;
-
     if (fNumLoGainEntry>fData->fLoGainPixId->GetSize())
         return kFALSE;
 
-/*
-    cout << fNumLoGainEntry << " " << flush;
-    cout << fData->fLoGainPixId->GetSize() << " " << flush;
-    cout << fData->fLoGainPixId->GetArray() << " " << flush;
-    cout << fLoGainId << endl;
-    */
-//    cout << (int)(fLoGainId-fData->fLoGainPixId->GetArray()) << " " << flush;
-//    cout << (int)(fHiGainId-fData->fHiGainPixId->GetArray()) << " " << flush;
-
     Bool_t rc = *fHiGainId!=*fLoGainId;
-
-//    cout << "done." << endl;
-
 
     if (rc)
         return kFALSE;
-    /*
-    // We have no lo-gain at all
-    if (!fLoGainId)
-        return kFALSE;
-
-    // This is to make the first call of this function in Next()
-    // work properly! NEVER call this function before Next()
-    if (fNumLoGainEntry==0)
-        return kTRUE;
-
-    // Make sure, that we don't exceed the last entry in the array!
-    if (fNumLoGainEntry==fData->fLoGainPixId->GetSize())
-        return kFALSE;
-
-    // Check whether the current position in lo-gain fits the hi-gain
-    return *fHiGainId!=*fLoGainId;
-     */
+
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 6252)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h	(revision 6253)
@@ -97,5 +97,5 @@
         // return kTRUE  the lo gains exist for the actual pixel, else return kFALSE
         //
-        return fABFlags ? TESTBIT(fABFlags[GetPixelId()/8], GetPixelId()%8) : 0;
+        return TESTBIT(GetABFlag(), GetPixelId()%8);
     }
     Byte_t GetABFlag() const
Index: trunk/MagicSoft/Mars/showlog.cc
===================================================================
--- trunk/MagicSoft/Mars/showlog.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/showlog.cc	(revision 6253)
@@ -19,5 +19,6 @@
     gLog << "   showlog [options] < filename" << endl << endl;
     gLog.Usage();
-    gLog << "   -?, -h, --help            This help" << endl << endl;
+    gLog << "   --version, -V             Show startup message with version number" << endl;
+    gLog << "   -?, -h, --help            This help" << endl;
     gLog << endl;
     gLog << " This program converts colored output  made with ansi codes" << endl;
@@ -49,4 +50,7 @@
 {
     MArgs arg(argc, argv);
+
+    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+        return 0;
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
Index: trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- trunk/MagicSoft/Mars/showplot.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/showplot.cc	(revision 6253)
@@ -41,5 +41,9 @@
     gLog << "   --save-as-gif[=filename]  Save plots as gif files" << endl;
     gLog << "   --save-as-C[=filename]    Save plots as root scripts" << endl;
-    gLog << "   --tab=num                 Save only tab number num" << endl << endl;
+    gLog << "   --tab=num                 Save only tab number num" << endl;
+    gLog << endl;
+    gLog << "   --version, -V             Show startup message with version number" << endl;
+    gLog << "   -?, -h, --help            This help" << endl;
+    gLog << endl;
     gLog << "Description:" << endl;
     gLog << " Use showplot to display a MStatusArray in an MStatusDisplay." << endl;
@@ -57,4 +61,7 @@
     //
     MArgs arg(argc, argv, kTRUE);
+
+    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+        return 0;
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
Index: trunk/MagicSoft/Mars/star.cc
===================================================================
--- trunk/MagicSoft/Mars/star.cc	(revision 6252)
+++ trunk/MagicSoft/Mars/star.cc	(revision 6253)
@@ -66,4 +66,5 @@
     gLog << "   --config=star.rc          Resource file [default=star.rc]" << endl;
     gLog << endl;
+    gLog << "   --version, -V             Show startup message with version number" << endl;
     gLog << "   -?, -h, --help            This help" << endl << endl;
 }
@@ -77,4 +78,7 @@
     //
     MArgs arg(argc, argv, kTRUE);
+
+    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+        return 0;
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
