diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index a07b8d964dd78b12958991cc5259bddcaf2fd2ff..d87557af7d2519d56b0ced690a4e6b722deb578e 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -467,7 +467,7 @@ static void Mesh2D(GModel *m)
   // and curve meshes) is global as it depends on a smooth normal
   // field generated from the surface mesh of the source surfaces
   if(!Mesh2DWithBoundaryLayers(m)){
-    std::set<GFace*> cf, f;
+    std::set<GFace*, GEntityLessThan> cf, f;
     for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
       if ((*it)->geomType() == GEntity::CompoundSurface)
         cf.insert(*it);
@@ -479,14 +479,15 @@ static void Mesh2D(GModel *m)
     int nIter = 0, nTot = m->getNumFaces();
     while(1){
       int nPending = 0;
-      std::vector<GFace*> _temp; _temp.insert(_temp.begin(), f.begin(), f.end());
+      std::vector<GFace*> temp;
+      temp.insert(temp.begin(), f.begin(), f.end());
 #if defined(_OPENMP)
 #pragma omp parallel for schedule (dynamic)
 #endif
-      for(size_t K = 0 ; K < _temp.size() ; K++){
-	if (_temp[K]->meshStatistics.status == GFace::PENDING){
-	  meshGFace mesher (true, CTX::instance()->mesh.multiplePasses);
-	  mesher(_temp[K]);
+      for(size_t K = 0 ; K < temp.size() ; K++){
+	if (temp[K]->meshStatistics.status == GFace::PENDING){
+	  meshGFace mesher(true, CTX::instance()->mesh.multiplePasses);
+	  mesher(temp[K]);
 #if defined(_OPENMP)
 #pragma omp critical
 #endif
@@ -499,9 +500,10 @@ static void Mesh2D(GModel *m)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-      for(std::set<GFace*>::iterator it = cf.begin(); it != cf.end(); ++it){
+      for(std::set<GFace*, GEntityLessThan>::iterator it = cf.begin();
+          it != cf.end(); ++it){
         if ((*it)->meshStatistics.status == GFace::PENDING){
-	  meshGFace mesher (true, CTX::instance()->mesh.multiplePasses);
+	  meshGFace mesher(true, CTX::instance()->mesh.multiplePasses);
           mesher(*it);
           nPending++;
         }
@@ -520,7 +522,8 @@ static void Mesh2D(GModel *m)
 	smoothing smm(CTX::instance()->mesh.optimizeLloyd,6);
 	m->writeMSH("beforeLLoyd.msh");
 	smm.optimize_face(*it);
-	//int rec = 1;//(CTX::instance()->mesh.recombineAll || (*it)->meshAttributes.recombine);
+	//int rec = 1;//(CTX::instance()->mesh.recombineAll ||
+        //              (*it)->meshAttributes.recombine);
 	m->writeMSH("afterLLoyd.msh");
 	//if(rec) recombineIntoQuads(*it);
 	//m->writeMSH("afterRecombine.msh");