diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index ee316e53952414639e0688cc9681355da97ce376..7b0eb4a72155881307058654f5918cce32ee9a51 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -284,13 +284,14 @@ double MElement::getJacobian(double u, double v, double w, double jac[3][3])
     }
     {
       double a[3], b[3], c[3];
-      a[0] = getVertex(1)->x() - getVertex(0)->x(); 
-      a[1] = getVertex(1)->y() - getVertex(0)->y();
-      a[2] = getVertex(1)->z() - getVertex(0)->z();     
-      b[0] = getVertex(2)->x() - getVertex(0)->x(); 
-      b[1] = getVertex(2)->y() - getVertex(0)->y();
-      b[2] = getVertex(2)->z() - getVertex(0)->z();     
+      a[0] = jac[0][0];
+      a[1] = jac[0][1];
+      a[2] = jac[0][2];
+      b[0] = jac[1][0];
+      b[1] = jac[1][1];
+      b[2] = jac[1][2];
       prodve(a, b, c);
+      norme(c);
       jac[2][0] = c[0]; jac[2][1] = c[1]; jac[2][2] = c[2]; 
     }
     return sqrt(SQU(jac[0][0] * jac[1][1] - jac[0][1] * jac[1][0]) +
@@ -781,8 +782,8 @@ void MTriangle::getGradShapeFunction(int num,double uu,double vv,double ww,doubl
     }
   }
   
-  for (int i=0;i<3;i++) s[i] = grads[num][i];
-  
+  for (int i=0;i<2;i++) s[i] = grads[num][i];
+  s[2] = 0;
 #endif
 }
 
diff --git a/Makefile b/Makefile
index 2e141cb4a257fbf8ad082c0d3b16dc3143ed53f0..e7f9bcab69b41b92297e475ea291d6bedf347882 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ GMSH_API = Geo/GModel.h Geo/GEntity.h Geo/GPoint.h\
            Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h\
            Geo/Pair.h Geo/Range.h\
            Post/PView.h Post/PViewData.h Post/PViewDataGModel.h\
-           Common/VertexArray.h\
+           Common/VertexArray.h Common/Message.h\
            Common/Gmsh.h Common/GmshDefines.h Common/GmshVersion.h Common/GmshMatrix.h
 
 GMSH_EMBEDDED = ${GMSH_API} Geo/discrete*.cpp\