diff --git a/Mesh/BackgroundMesh.h b/Mesh/BackgroundMesh.h
index 393b1eb349296d26dc86f7bd8f0e39ef6829e93a..103bb924b8d6efdfd2ad2fa8317ec2f45b540a44 100644
--- a/Mesh/BackgroundMesh.h
+++ b/Mesh/BackgroundMesh.h
@@ -9,6 +9,7 @@
 #include "STensor3.h"
 #include "simpleFunction.h"
 #include <vector>
+#include <list>
 
 class MElementOctree;
 class GFace;
@@ -71,5 +72,6 @@ bool Extend1dMeshIn2dSurfaces();
 bool Extend2dMeshIn3dVolumes();
 SMetric3 max_edge_curvature_metric(const GVertex *gv, double &l);
 SMetric3 max_edge_curvature_metric(const GEdge *ge, double u, double &l);
+void replaceMeshCompound(GFace*,std::list<GEdge*>&);
 
 #endif
diff --git a/Mesh/meshGFaceLloyd.cpp b/Mesh/meshGFaceLloyd.cpp
index 8712e771ae549ae25fc80857c7836b203669b0f3..c9b7d225d0b824dd4712967a143cb936d6ebaa29 100644
--- a/Mesh/meshGFaceLloyd.cpp
+++ b/Mesh/meshGFaceLloyd.cpp
@@ -323,11 +323,13 @@ void smoothing::optimize_face(GFace* gf){
   w.set_max(2*ITER_MAX);
   w.set_triangulator(&triangulator);
   w.set_octree(octree);
-	
-  minlbfgscreate(2*num_interior,4,x,state);
-  minlbfgssetcond(state,epsg,epsf,epsx,maxits);
-  minlbfgsoptimize(state,callback,NULL,&w);
-  minlbfgsresults(state,x,rep);
+
+  if(num_interior>0){
+    minlbfgscreate(2*num_interior,4,x,state);
+    minlbfgssetcond(state,epsg,epsf,epsx,maxits);
+    minlbfgsoptimize(state,callback,NULL,&w);
+    minlbfgsresults(state,x,rep);
+  }
 
   /*lpcvt obj2;
   SPoint2 val = obj2.seed(triangulator,gf);
diff --git a/Numeric/DivideAndConquer.cpp b/Numeric/DivideAndConquer.cpp
index c00acdd004eebb8cb532366640eb43b919a3b1c2..2ab5ea79d171ad8231eb9fb353a96a428b3f5559 100644
--- a/Numeric/DivideAndConquer.cpp
+++ b/Numeric/DivideAndConquer.cpp
@@ -19,6 +19,7 @@
 #include "DivideAndConquer.h"
 #include "Numeric.h"
 #include "robustPredicates.h"
+#include "BackgroundMesh.h"
 
 // FIXME: should not introduce dependencies to Geo/ code in Numeric
 #include "GPoint.h"
@@ -935,6 +936,7 @@ void DocRecord::concave(double x,double y,GFace* gf){
   std::set<int>::iterator it2;
   
   list = gf->edges();
+  replaceMeshCompound(gf,list);
   for(it1=list.begin();it1!=list.end();it1++){
 	edge = *it1;
 	for(i=0;i<edge->getNumMeshElements();i++){
@@ -1076,6 +1078,7 @@ bool DocRecord::delaunay_conformity(GFace* gf){
   std::list<GEdge*>::iterator it;
 	
   list = gf->edges();
+  replaceMeshCompound(gf,list);
   for(it=list.begin();it!=list.end();it++){
     edge = *it;
 	for(i=0;i<edge->getNumMeshElements();i++){