diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h
index c79edb5bff3836b2cf45ae5982b60375d5dbfe33..8a28bf9e76df4d7f108ce1b58a31eb184d141d98 100644
--- a/Mesh/Mesh.h
+++ b/Mesh/Mesh.h
@@ -21,7 +21,8 @@
 #define FORMAT_SMS     14
 #define FORMAT_OPT     15
 #define FORMAT_PSTEX   16
-#define FORMAT_TEX     17
+#define FORMAT_JPEGTEX 17
+#define FORMAT_TEX     18
 
 #define CONV_VALUE    0.8
 
diff --git a/Mesh/Utils.cpp b/Mesh/Utils.cpp
index 5f893d4fa98cf1648a700f60f0aa827e9805242c..68744c654794ce6d52e9e91efc1f6c4e57197a2f 100644
--- a/Mesh/Utils.cpp
+++ b/Mesh/Utils.cpp
@@ -1,4 +1,4 @@
-// $Id: Utils.cpp,v 1.5 2001-11-08 10:16:41 geuzaine Exp $
+// $Id: Utils.cpp,v 1.6 2001-11-19 13:43:17 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "Numeric.h"
@@ -47,7 +47,7 @@ void MeanPlane(List_T *points, Surface *s){
   na = 3;
 
   U = dmatrix(1,ndata,1,na);
-  V = dmatrix(1,ndata,1,ndata);
+  V = dmatrix(1,na,1,na);
   W = dvector(1,na);
 
   for (i=0; i<ndata; i++){
@@ -79,7 +79,7 @@ void MeanPlane(List_T *points, Surface *s){
   norme(res);
 
   free_dmatrix(U,1,ndata,1,na);
-  free_dmatrix(V,1,ndata,1,ndata);
+  free_dmatrix(V,1,na,1,na);
   free_dvector(W,1,na);
 
   // check coherence of results for non-plane surfaces