Index: trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.cc	(revision 8158)
+++ trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.cc	(revision 8165)
@@ -210,28 +210,11 @@
     // Take also a possible offset from timefineadjust into account
     //  Sould it be: fTime += fWindowSize/2; ???
+
+    // HERE we should add the distance from the beginning of the
+    // extraction window to the leading edge!
     fTime += 0.5 + 0.5/fWeightsPerBin;
-    // In the ideal case the would never get <0
-    // But timefineadjust can be >0.05 (in 60% of the cases)
-
     // Define in each extractor a lowest and highest extracted value!
 
-    // here, the first high-gain slice is already included
-    // in the fTimeShiftHiGain this shifts the time to the
-    // start of the rising edge
-
-    // This is from MExtractTimeAndChargeDigitalFilter
-    // fTime += 0.5 + 1./fWeightsPerBin;
-
-    // Now there is a difference between the rising edge and
-    // the extracted time. This must be applied after
-    // the randomization in case of wrog values
-
     const Float_t timefineadjust = sumtime/sumamp;
-
-    // FIXME: Is 3 a good value?
-    //if (TMath::Abs(timefineadjust)*fWeightsPerBin < 3.)
-    //    fTime -= timefineadjust;
-
-    //    if (TMath::FloorNint(timefineadjust+0.5)==0)
 
     //if (TMath::Abs(timefineadjust) < 0.2)
Index: trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc
===================================================================
--- trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc	(revision 8158)
+++ trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc	(revision 8165)
@@ -69,4 +69,7 @@
 void MExtralgoSpline::InitDerivatives() const
 {
+    if (fNum<2)
+        return;
+
     fDer1[0] = 0.;
     fDer2[0] = 0.;
@@ -211,4 +214,7 @@
 Float_t MExtralgoSpline::ExtractNoise(/*Int_t iter*/)
 {
+    if (fNum<5)
+        return 0;
+
     // FIXME: Shell we keep the extraction inside one slice
     // or randomize it along the extraction window?
@@ -216,7 +222,7 @@
 
     if (fExtractionType == kAmplitude)
-        return Eval(1, nsx);
+        return Eval(2, nsx);
     else
-        return CalcIntegral(2. + nsx);
+        return CalcIntegral(2 + nsx);
 }
 
@@ -227,4 +233,7 @@
     fSignalDev = -1;
     fTimeDev   = -1;
+
+    if (fNum<2)
+        return;
 /*
     //
@@ -373,5 +382,5 @@
 
     Float_t maxpos, maxval;
-    // FIXME: Check the dfeault if no maximum found!!!
+    // FIXME: Check the default if no maximum found!!!
     GetMaxAroundI(maxbin, maxpos, maxval);
 
