diff --git a/Mesh/meshGRegionLocalMeshMod.cpp b/Mesh/meshGRegionLocalMeshMod.cpp
index d21ec6d089e5da245306a659db5a6910f30c3c3a..a89b892eba464bd300f741b5691b1d60e79eabdc 100644
--- a/Mesh/meshGRegionLocalMeshMod.cpp
+++ b/Mesh/meshGRegionLocalMeshMod.cpp
@@ -107,7 +107,7 @@ bool buildEdgeCavity(MTet4 *t, int iLocalEdge, MVertex **v1, MVertex **v2,
       return false;
     }
     // FIXME when hybrid mesh, this loops for ever
-    if (cavity.size() > 1000)return false;
+    if (cavity.size() > 1000) return false;
     //    printf("%d %d\n",ITER++, cavity.size());
   }
   computeNeighboringTetsOfACavity (cavity,outside);
@@ -453,8 +453,9 @@ void buildVertexCavity_recur(MTet4 *t, MVertex *v, std::vector<MTet4*> &cavity)
     }
   }
   if (iV == -1){
-    Msg::Fatal("trying to build a cavity of tets for a vertex that does not "
-        "belong to this tet");
+    Msg::Error("Trying to build a cavity of tets for a vertex that does not "
+               "belong to this tet");
+    return;
   }
   for (int i = 0; i < 3; i++){
     MTet4 *neigh = t->getNeigh(vFac[iV][i]);
diff --git a/Post/PViewVertexArrays.cpp b/Post/PViewVertexArrays.cpp
index c6305ce7180f1e38fbb61e20b26c0c71a374871a..d26d909fe412609a6683f1cb9a15fba7ff1ff5fc 100644
--- a/Post/PViewVertexArrays.cpp
+++ b/Post/PViewVertexArrays.cpp
@@ -677,7 +677,8 @@ static void addScalarPolygon(PView *p, double **xyz,
         ite != edges.end(); ite++){
       int i = (int) (*ite).second / 100;
       int j = (*ite).second % 100;
-      addScalarLine(p, xyz, val, pre, 3*i+il[j][0], 3*i+il[j][0], true);
+      if(j < 3)
+        addScalarLine(p, xyz, val, pre, 3*i+il[j][0], 3*i+il[j][0], true);
     }
     opt->boundary++;
 
@@ -858,6 +859,7 @@ static void addScalarPyramid(PView *p, double **xyz,
 static void addOutlinePolyhedron(PView *p, double **xyz,
                                  unsigned int color, bool pre, int numNodes)
 {
+  // FIXME: this code is horribly slow
   const int it[4][3] = {{0, 2, 1}, {0, 1, 3}, {0, 3, 2}, {3, 1, 2}};
   std::map<MFace, int, Less_Face> triFaces;
   std::vector<MVertex *> verts;
@@ -878,7 +880,8 @@ static void addOutlinePolyhedron(PView *p, double **xyz,
       ite != triFaces.end(); ite++){
     int i = (int) (*ite).second / 100;
     int j = (*ite).second % 100;
-    addOutlineTriangle(p, xyz, color, pre, 4*i+it[j][0], 4*i+it[j][1], 4*i+it[j][2]);
+    if(j < 4)
+      addOutlineTriangle(p, xyz, color, pre, 4*i+it[j][0], 4*i+it[j][1], 4*i+it[j][2]);
   }
   for(int i = 0; i < numNodes; i++)
     delete verts[i];