diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp
index 15dad82cbeeacab5871f4876e3e28630ce776f54..87174d8eca44c9191c1f1495e9d24ebe3c15a0bc 100644
--- a/Common/CommandLine.cpp
+++ b/Common/CommandLine.cpp
@@ -1,4 +1,4 @@
-// $Id: CommandLine.cpp,v 1.76 2006-08-12 17:44:24 geuzaine Exp $
+// $Id: CommandLine.cpp,v 1.77 2006-08-16 22:43:55 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -233,14 +233,6 @@ void Get_Options(int argc, char *argv[])
         CTX.mesh.oldxtrude_recombine = 1;
         i++;
       }
-      else if(!strcmp(argv[i] + 1, "dupli")) {
-        CTX.mesh.check_duplicates = 1;
-        i++;
-      }
-      else if(!strcmp(argv[i] + 1, "histogram")) {
-        CTX.mesh.histogram = 1;
-        i++;
-      }
       else if(!strcmp(argv[i] + 1, "optimize")) {
         CTX.mesh.optimize = 1;
         i++;
diff --git a/Common/Context.h b/Common/Context.h
index f885cbbf661ff8813dc7ed87cdc452f118ad76cb..19aa7096c7a1a7a01059aa1054cd133cd1fa61f5 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -139,13 +139,12 @@ public :
 
   // geometry options 
   struct{
-    int vis_type;
     int points, lines, surfaces, volumes;
     int points_num, lines_num, surfaces_num, volumes_num;
     double point_size, line_width, point_sel_size, line_sel_width;
     int point_type, line_type; // flat or 3D
     int light;
-    int level, old_circle, circle_points;
+    int old_circle, circle_points;
     int extrude_spline_points, old_newreg;
     double normals, tangents;
     double scaling_factor;
@@ -156,8 +155,7 @@ public :
   // mesh options 
   struct {
     double msh_file_version;
-    int vis_type, changed, vertex_arrays;
-    int draw;
+    int changed, draw;
     int points, lines, surfaces_edges, surfaces_faces, volumes_edges, volumes_faces;
     int points_num, lines_num, surfaces_num, volumes_num;
     double label_frequency;
@@ -173,7 +171,7 @@ public :
     int format, nbPartitions, nb_smoothing, algo2d, algo3d, order, algo_recombine;
     int point_insertion, speed_max, min_circ_points;
     int bgmesh_type, constrained_bgmesh;
-    int histogram, initial_only;
+    int initial_only;
     double normals, tangents, explode;
     int color_carousel;
     int use_cut_plane, cut_plane_draw_intersect, cut_plane_only_volume;
@@ -182,14 +180,14 @@ public :
       double val = cut_planea * x + cut_planeb * y + cut_planec * z + cut_planed; 
       return val;
     }
-    int oldxtrude, oldxtrude_recombine, check_duplicates;
+    int oldxtrude, oldxtrude_recombine;
     int allow_degenerated_extrude, save_all;
     char *triangle_options;
     int smooth_normals;
     double angle_smooth_normals;
     double stl_distance_tol, dihedral_angle_tol;
     int edge_prolongation_threshold, do_not_coarsen;
-    double  nb_elem_per_rc ,   min_elem_size_fact , target_elem_size_fact, beta_smooth_metric;
+    double  nb_elem_per_rc, min_elem_size_fact, target_elem_size_fact, beta_smooth_metric;
   } mesh;
 
   // post processing options 
@@ -231,7 +229,6 @@ public :
     } geom;
     struct{
       unsigned int vertex, line, triangle, quadrangle;
-      unsigned int tetrahedron, hexahedron, prism, pyramid;
       unsigned int carousel[20];
       unsigned int tangents, normals;
     } mesh;
diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index a2f37938fb42f52ac6a9e5a8769a0ba1dd099c5d..df9bdd1722296e9eaab6a0836966ce83c79167fd 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -994,8 +994,6 @@ StringXNumber MeshOptions_Number[] = {
   { F|O, "TargetElmentSizeFact" , opt_mesh_target_elem_size_fact, 20. ,
     "Target element size factor in the Remesher" },
 
-  { F|O, "VertexArrays" , opt_mesh_vertex_arrays , 1. , 
-    "Use OpenGL vertex arrays to draw triangular meshes?" },
   { F|O, "VolumeEdges" , opt_mesh_volumes_edges , 1. , 
     "Display edges of volume mesh?" },
   { F|O, "VolumeFaces" , opt_mesh_volumes_faces , 0. , 
@@ -1475,18 +1473,6 @@ StringXColor MeshOptions_Color[] = {
   { F|O, "Quadrangles" , opt_mesh_color_quadrangles ,
     COLQ, COLQ, COLW, 
     "Mesh quadrangle color (if Mesh.ColorCarousel=0)" },
-  { F|O, "Tetrahedra" , opt_mesh_color_tetrahedra ,
-    COLT, COLT, COLW,
-     "Mesh tetrahedron color (if Mesh.ColorCarousel=0)" },
-  { F|O, "Hexahedra" , opt_mesh_color_hexahedra ,
-    COLQ, COLQ, COLW, 
-    "Mesh hexahedron color (if Mesh.ColorCarousel=0)" },
-  { F|O, "Prisms" , opt_mesh_color_prisms ,
-    COLP, COLP, COLW,
-     "Mesh prism color (if Mesh.ColorCarousel=0)" },
-  { F|O, "Pyramids" , opt_mesh_color_pyramid ,
-    COLY, COLY, COLW,
-     "Mesh pyramid color (if Mesh.ColorCarousel=0)" },
   { F|O, "Tangents" , opt_mesh_color_tangents ,
     {255, 255, 0, 255}, {255, 255, 0, 255}, {0, 0, 0, 255},
     "Tangent mesh vector color" },
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 9a70401150ca83463bfa27bb80798fca85c21283..e2e9f6b865ca0de2b7570aecfb813b723714b240 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.291 2006-08-16 21:11:41 geuzaine Exp $
+// $Id: Options.cpp,v 1.292 2006-08-16 22:43:56 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -132,19 +132,14 @@ void Init_Options(int num)
   CTX.pixel_equiv_x = CTX.pixel_equiv_y = 0.;
   CTX.polygon_offset = 0;
   CTX.mesh_timer[0] = CTX.mesh_timer[1] = CTX.mesh_timer[2] = 0.;
-  CTX.geom.vis_type = 0;
-  CTX.geom.level = ELEMENTARY;
-  CTX.mesh.vis_type = 0;
   CTX.mesh.draw = 1;
   CTX.post.draw = 1;
   CTX.post.list = NULL;
   CTX.post.force_num = 0;
   CTX.print.gl_fonts = 1;
   CTX.threads_lock = 0; // very primitive locking
-  CTX.mesh.histogram = 0;
   CTX.mesh.changed = 1;
   CTX.mesh.oldxtrude = CTX.mesh.oldxtrude_recombine = 0; // old extrusion mesh generator
-  CTX.mesh.check_duplicates = 0; // check for duplicate nodes when loading a mesh
   CTX.mesh.bgmesh_type = WITHPOINTS;
   CTX.post.combine_time = 0; // try to combine_time views at startup
   CTX.post.plugin_draw_function = NULL;
@@ -4192,7 +4187,6 @@ double opt_mesh_points(OPT_ARGS_NUM)
 double opt_mesh_lines(OPT_ARGS_NUM)
 {
   if(action & GMSH_SET) {
-    if(CTX.mesh.lines != val) CTX.mesh.changed = 1;
     CTX.mesh.lines = (int)val;
   }
 #if defined(HAVE_FLTK)
@@ -4364,14 +4358,6 @@ double opt_mesh_line_type(OPT_ARGS_NUM)
   return CTX.mesh.line_type;
 }
 
-double opt_mesh_vertex_arrays(OPT_ARGS_NUM)
-{
-  if(action & GMSH_SET) {
-    CTX.mesh.vertex_arrays = (int)val;
-  }
-  return CTX.mesh.vertex_arrays;
-}
-
 double opt_mesh_smooth_normals(OPT_ARGS_NUM)
 {
   if(action & GMSH_SET) {
@@ -7058,57 +7044,13 @@ unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL)
   return CTX.color.mesh.quadrangle;
 }
 
-unsigned int opt_mesh_color_tetrahedra(OPT_ARGS_COL)
-{
-  if(action & GMSH_SET) {
-    CTX.color.mesh.tetrahedron = val;
-  }
-#if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.tetrahedron, WID->mesh_col[4]);
-#endif
-  return CTX.color.mesh.tetrahedron;
-}
-
-unsigned int opt_mesh_color_hexahedra(OPT_ARGS_COL)
-{
-  if(action & GMSH_SET) {
-    CTX.color.mesh.hexahedron = val;
-  }
-#if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.hexahedron, WID->mesh_col[5]);
-#endif
-  return CTX.color.mesh.hexahedron;
-}
-
-unsigned int opt_mesh_color_prisms(OPT_ARGS_COL)
-{
-  if(action & GMSH_SET) {
-    CTX.color.mesh.prism = val;
-  }
-#if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.prism, WID->mesh_col[6]);
-#endif
-  return CTX.color.mesh.prism;
-}
-
-unsigned int opt_mesh_color_pyramid(OPT_ARGS_COL)
-{
-  if(action & GMSH_SET) {
-    CTX.color.mesh.pyramid = val;
-  }
-#if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.pyramid, WID->mesh_col[7]);
-#endif
-  return CTX.color.mesh.pyramid;
-}
-
 unsigned int opt_mesh_color_tangents(OPT_ARGS_COL)
 {
   if(action & GMSH_SET) {
     CTX.color.mesh.tangents = val;
   }
 #if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.tangents, WID->mesh_col[8]);
+  CCC(CTX.color.mesh.tangents, WID->mesh_col[4]);
 #endif
   return CTX.color.mesh.tangents;
 }
@@ -7119,7 +7061,7 @@ unsigned int opt_mesh_color_normals(OPT_ARGS_COL)
     CTX.color.mesh.normals = val;
   }
 #if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.normals, WID->mesh_col[9]);
+  CCC(CTX.color.mesh.normals, WID->mesh_col[5]);
 #endif
   return CTX.color.mesh.normals;
 }
@@ -7134,7 +7076,7 @@ unsigned int opt_mesh_color_(int i, OPT_ARGS_COL)
     CTX.color.mesh.carousel[i] = val;
   }
 #if defined(HAVE_FLTK)
-  CCC(CTX.color.mesh.carousel[i], WID->mesh_col[10+i]);
+  CCC(CTX.color.mesh.carousel[i], WID->mesh_col[6+i]);
 #endif
   return CTX.color.mesh.carousel[i];
 }
diff --git a/Common/Options.h b/Common/Options.h
index 97d782bae550f812e963d70bc6b273c0b3b34b01..3c6d6db31a128f219387a9c9c82ede036065e9c2 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -654,10 +654,6 @@ unsigned int opt_mesh_color_points(OPT_ARGS_COL);
 unsigned int opt_mesh_color_lines(OPT_ARGS_COL); 
 unsigned int opt_mesh_color_triangles(OPT_ARGS_COL);
 unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL);
-unsigned int opt_mesh_color_tetrahedra(OPT_ARGS_COL);
-unsigned int opt_mesh_color_hexahedra(OPT_ARGS_COL);
-unsigned int opt_mesh_color_prisms(OPT_ARGS_COL);
-unsigned int opt_mesh_color_pyramid(OPT_ARGS_COL);
 unsigned int opt_mesh_color_tangents(OPT_ARGS_COL);
 unsigned int opt_mesh_color_normals(OPT_ARGS_COL);
 unsigned int opt_mesh_color_0(OPT_ARGS_COL);
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index fb675722ccdd1a46a2930965e1fcdde99d20bff3..9a32aafbc47ce29a7c18377ca2a395a77ca3be68 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.519 2006-08-16 21:55:26 geuzaine Exp $
+// $Id: GUI.cpp,v 1.520 2006-08-16 22:43:56 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -2591,7 +2591,7 @@ void GUI::create_option_window()
       o->hide();
 
       static Fl_Menu_Item menu_mesh_color[] = {
-        {"By element type", 0, 0, 0},
+        {"By geometrical type", 0, 0, 0},
         {"By elementary entity", 0, 0, 0},
         {"By physical group", 0, 0, 0},
         {"By mesh partition", 0, 0, 0},
diff --git a/Geo/MElement.h b/Geo/MElement.h
index 839da95a7975032ad2e417f9a282152e192a469c..4d10bf3e6686a97ec2b52399c10eca614c7f9614 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -520,15 +520,15 @@ class MPrism : public MElement {
   virtual int getNumFaces(){ return 5; }
   virtual MFace getFace(int num)
   {
-    if(num < 3)
+    if(num < 2)
       return MFace(_v[trifaces_prism[num][0]],
 		   _v[trifaces_prism[num][1]],
 		   _v[trifaces_prism[num][2]]);
     else
-      return MFace(_v[quadfaces_prism[num - 3][0]],
-		   _v[quadfaces_prism[num - 3][1]],
-		   _v[quadfaces_prism[num - 3][2]],
-		   _v[quadfaces_prism[num - 3][3]]);
+      return MFace(_v[quadfaces_prism[num - 2][0]],
+		   _v[quadfaces_prism[num - 2][1]],
+		   _v[quadfaces_prism[num - 2][2]],
+		   _v[quadfaces_prism[num - 2][3]]);
   }
   int getTypeForMSH(){ return PRI1; }
   int getTypeForUNV(){ return 112; } // WEDGE
diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp
index 17ea383fe35fcca7de01d6574fffc2eb37f31833..8d9081b41340d3fa5b43543f9a68f9732ea04666 100644
--- a/Graphics/Mesh.cpp
+++ b/Graphics/Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Mesh.cpp,v 1.171 2006-08-16 21:11:41 geuzaine Exp $
+// $Id: Mesh.cpp,v 1.172 2006-08-16 22:43:56 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -725,16 +725,12 @@ class drawMeshGRegion {
     }
     
     if(CTX.mesh.volumes_faces){
-      // Note: color will be incorrect for mixed meshes when coloring
-      // by element type
-      unsigned int col3 = r->tetrahedra.size() ? CTX.color.mesh.tetrahedron :
-	r->prisms.size() ? CTX.color.mesh.prism : CTX.color.mesh.pyramid;
       drawArrays(m->va_triangles, GL_TRIANGLES, CTX.mesh.light, 
-		 CTX.mesh.color_carousel == 3, CTX.polygon_offset, getColor(r, 0, col3));
-      unsigned int col4 = r->hexahedra.size() ? CTX.color.mesh.hexahedron :
-	r->prisms.size() ? CTX.color.mesh.prism : CTX.color.mesh.pyramid;
+		 CTX.mesh.color_carousel == 3, CTX.polygon_offset, 
+		 getColor(r, 0, CTX.color.mesh.triangle));
       drawArrays(m->va_quads, GL_QUADS, CTX.mesh.light, 
-		 CTX.mesh.color_carousel == 3, CTX.polygon_offset, getColor(r, 0, col4));
+		 CTX.mesh.color_carousel == 3, CTX.polygon_offset, 
+		 getColor(r, 0, CTX.color.mesh.quadrangle));
     }
     
     if(CTX.mesh.volumes_num) {
diff --git a/doc/texinfo/opt_mesh.texi b/doc/texinfo/opt_mesh.texi
index 35708044ad250dccbc845104793274478393269e..8541ffb1ade9631878767d9a06943b39a9159475 100644
--- a/doc/texinfo/opt_mesh.texi
+++ b/doc/texinfo/opt_mesh.texi
@@ -359,11 +359,6 @@ Target element size factor in the Remesher@*
 Default value: @code{20}@*
 Saved in: @code{General.OptionsFileName}
 
-@item Mesh.VertexArrays
-Use OpenGL vertex arrays to draw triangular meshes?@*
-Default value: @code{1}@*
-Saved in: @code{General.OptionsFileName}
-
 @item Mesh.VolumeEdges
 Display edges of volume mesh?@*
 Default value: @code{1}@*
@@ -404,26 +399,6 @@ Mesh quadrangle color (if Mesh.ColorCarousel=0)@*
 Default value: @code{@{130,120,225@}}@*
 Saved in: @code{General.OptionsFileName}
 
-@item Mesh.Color.Tetrahedra
-Mesh tetrahedron color (if Mesh.ColorCarousel=0)@*
-Default value: @code{@{160,150,255@}}@*
-Saved in: @code{General.OptionsFileName}
-
-@item Mesh.Color.Hexahedra
-Mesh hexahedron color (if Mesh.ColorCarousel=0)@*
-Default value: @code{@{130,120,225@}}@*
-Saved in: @code{General.OptionsFileName}
-
-@item Mesh.Color.Prisms
-Mesh prism color (if Mesh.ColorCarousel=0)@*
-Default value: @code{@{232,210,23@}}@*
-Saved in: @code{General.OptionsFileName}
-
-@item Mesh.Color.Pyramids
-Mesh pyramid color (if Mesh.ColorCarousel=0)@*
-Default value: @code{@{217,113,38@}}@*
-Saved in: @code{General.OptionsFileName}
-
 @item Mesh.Color.Tangents
 Tangent mesh vector color@*
 Default value: @code{@{255,255,0@}}@*