diff --git a/Post/OctreePost.cpp b/Post/OctreePost.cpp
index 64b7c7d88ccfae8f67639c7d2a8493c348bf73c4..f74eab2fbf1555c1b5a75bee891b3db3466bd84d 100644
--- a/Post/OctreePost.cpp
+++ b/Post/OctreePost.cpp
@@ -393,22 +393,8 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
   return true;
 } 
 
-bool OctreePost::searchScalar(double x, double y, double z, double *values, 
-                              int step, double *size)
-{
-  bool a =  searchScalar_(x,y,z,values,step,size);
-  if (!a){
-    element::setTolerance(10.);
-    a =  searchScalar_(x,y,z,values,step,size);
-    element::setTolerance(1.e-3);
-  }    
-  if (!a)printf("cannot find %g %g %g\n",x,y,z);
-  return a;
-}
-
-
-bool OctreePost::searchScalar_(double x, double y, double z, double *values, 
-                              int step, double *size)
+bool OctreePost::_searchScalar(double x, double y, double z, double *values, 
+                               int step, double *size)
 {
   double P[3] = {x, y, z};
 
@@ -438,6 +424,20 @@ bool OctreePost::searchScalar_(double x, double y, double z, double *values,
   return false;
 }
 
+bool OctreePost::searchScalar(double x, double y, double z, double *values, 
+                              int step, double *size)
+{
+  bool a = _searchScalar(x, y, z, values, step, size);
+  if (!a){
+    double oldeps = element::getTolerance();
+    element::setTolerance(10.);
+    a = _searchScalar(x, y, z, values, step, size);
+    element::setTolerance(oldeps);
+  }    
+  if (!a) Msg::Debug("No element found containing point (%g,%g,%g)", x, y, z);
+  return a;
+}
+
 bool OctreePost::searchVector(double x, double y, double z, double *values, 
                               int step, double *size)
 {
diff --git a/Post/OctreePost.h b/Post/OctreePost.h
index 172125d449fd97b13f61f28a8cd5194a4adbb9cc..bd6770d5173d13773db650905f5842e364c4c499 100644
--- a/Post/OctreePost.h
+++ b/Post/OctreePost.h
@@ -30,8 +30,8 @@ class OctreePost
                  double *elementSize);
   bool _getValue(void *in, int nbComp, double P[3], int step, 
                  double *values, double *elementSize);
-  bool searchScalar_(double x, double y, double z, double *values, 
-                    int step = -1, double *size = 0);
+  bool _searchScalar(double x, double y, double z, double *values, 
+                     int step = -1, double *size = 0);
  public :
   OctreePost(PView *);
   ~OctreePost();
diff --git a/Post/shapeFunctions.cpp b/Post/shapeFunctions.cpp
index 47681c4e0ff016e8c8c7672fd19c446fcf5aa900..69c5aee5e897ad58d49b0db4d6cb410a56cda505 100644
--- a/Post/shapeFunctions.cpp
+++ b/Post/shapeFunctions.cpp
@@ -1,3 +1,9 @@
+// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
+//
+// See the LICENSE.txt file for license information. Please report all
+// bugs and problems to <gmsh@geuz.org>.
+
 #include "shapeFunctions.h"
-double element::ONE = 1.+1.e-2;
-double element::ZERO = -1.e-2;
+
+double element::ONE = 1. + 1.e-6;
+double element::ZERO = -1.e-6;
diff --git a/Post/shapeFunctions.h b/Post/shapeFunctions.h
index da06e97770ed22c9a54a30abd3d31f69fb8a926d..965347251d54336424284385171f3100a9741204 100644
--- a/Post/shapeFunctions.h
+++ b/Post/shapeFunctions.h
@@ -17,13 +17,8 @@ protected:
   static double ONE, ZERO;
 public:
   element(double *x, double *y, double *z) : _x(x), _y(y), _z(z) {}
-  static void setTolerance (const double tol){
-    ONE = 1.+tol;
-    ZERO = -tol;
-  }
-  static double getTolerance () {
-    return -ZERO;
-  }
+  static void setTolerance (const double tol){ ONE = 1. + tol; ZERO = -tol; }
+  static double getTolerance () { return -ZERO; }
   virtual ~element(){}
   virtual int getDimension() = 0;
   virtual int getNumNodes() = 0;