Index: trunk/MagicSoft/Mars/mbase/MAGIC.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MAGIC.cc	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MAGIC.cc	(revision 9518)
@@ -40,4 +40,11 @@
 bool MARS::CheckRootVer()
 {
+    if (strcmp(gROOT->GetVersion(), "5.22/00")>0)
+    {
+        cout << "WARNING - Especially root 5.24/00 has a severe bug in projection 2D histograms" << endl;
+        cout << "          which might cause unexpected crashes and could also affect the results." << endl;
+        cout << "          Please, avoid using these root versions." << endl;
+    }
+
     if (!strcmp(gROOT->GetVersion(), ROOT_RELEASE))
         return true;
Index: trunk/MagicSoft/Mars/mbase/MEnv.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 9518)
@@ -41,5 +41,5 @@
     Int_t       GetValue(const char *name, Int_t dflt);
     Double_t    GetValue(const char *name, Double_t dflt);
-    const char *GetValue(const char *name, const char *dflt);
+    const char *GetValue(const char *name, const char *dflt="");
 
     // GetValue: regexp
Index: trunk/MagicSoft/Mars/mbase/MLut.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLut.cc	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MLut.cc	(revision 9518)
@@ -38,4 +38,6 @@
 #include <stdlib.h>  // atoi (Ubuntu 8.10)
 
+#include <TRegexp.h>
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -286,5 +288,9 @@
 Int_t MLut::ReadStream(istream &fin)
 {
+    static const TRegexp reg("[^ 1234567890]");
+
     Delete();
+
+    Int_t n = 0;
 
     while (1)
@@ -294,4 +300,12 @@
         if (!fin)
             break;
+
+        n++;
+
+        if (line.Contains(reg))
+        {
+            gLog << warn << "WARNING - MLut::ReadStream: Line #" << n << " contains invalid character... ignored." << endl;
+            continue;
+        }
 
         // Split line by whitespaces
Index: trunk/MagicSoft/Mars/mbase/MParSpline.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParSpline.cc	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MParSpline.cc	(revision 9518)
@@ -322,2 +322,8 @@
     fSpline->Paint("PC");
 }
+
+void MParSpline::RecursiveRemove(TObject *obj)
+{
+    if (obj==fSpline)
+        fSpline=0;
+}
Index: trunk/MagicSoft/Mars/mbase/MParSpline.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParSpline.h	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MParSpline.h	(revision 9518)
@@ -23,4 +23,5 @@
 public:
     MParSpline(const char *name=0, const char *title=0);
+    ~MParSpline()  { Clear(); }
 
     // MParSpline
@@ -50,4 +51,6 @@
     void Paint(Option_t *o="");
 
+    void RecursiveRemove(TObject *obj);
+
     ClassDef(MParSpline, 1) // Container to hold a MSpline3
 };
Index: trunk/MagicSoft/Mars/mbase/MSpline3.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MSpline3.cc	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MSpline3.cc	(revision 9518)
@@ -157,5 +157,5 @@
 //     W := fX[i+1]-fX[i]
 //
-Double_t MSpline3::Integral(Int_t i, Double_t x) const
+Double_t MSpline3::IntegralBin(Int_t i, Double_t x) const
 {
     Double_t x0, y, b, c, d;
@@ -171,5 +171,5 @@
 // Return the integral of the spline's bin i.
 //
-Double_t MSpline3::Integral(Int_t i) const
+Double_t MSpline3::IntegralBin(Int_t i) const
 {
     Double_t x, y;
@@ -177,5 +177,5 @@
     GetKnot(i+1, x, y);
 
-    return Integral(i, x);
+    return IntegralBin(i, x);
 }
 
@@ -189,10 +189,10 @@
     const Int_t m = FindX(b);
 
-    Double_t sum = -Integral(n, a);
+    Double_t sum = -IntegralBin(n, a);
 
     for (int i=n; i<=m-1; i++)
-        sum += Integral(i);
-
-    sum += Integral(m, b);
+        sum += IntegralBin(i);
+
+    sum += IntegralBin(m, b);
 
     return sum;
@@ -208,5 +208,5 @@
 
     for (int i=0; i<GetNp()-1; i++)
-        sum += Integral(i);
+        sum += IntegralBin(i);
 
     return sum;
Index: trunk/MagicSoft/Mars/mbase/MSpline3.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MSpline3.h	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/MSpline3.h	(revision 9518)
@@ -15,6 +15,6 @@
     MArrayD &ConvertFunc(const TF1 &f, Float_t freq) const;
 
-    Double_t Integral(Int_t i, Double_t x) const;
-    Double_t Integral(Int_t i) const;
+    Double_t IntegralBin(Int_t i, Double_t x) const;
+    Double_t IntegralBin(Int_t i) const;
 
 public:
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 9497)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 9518)
@@ -6,6 +6,6 @@
 #
 ##################################################################
+include ../Makefile.conf.general
 include ../Makefile.conf.$(OSTYPE)
-include ../Makefile.conf.general
 
 #------------------------------------------------------------------------------
