diff --git a/Geo/MElementCut.h b/Geo/MElementCut.h
index a1926315740bc05f002d3372deaf293bfef564e0..124daf26adf9e1d0a340f9f4291b525bf91de78c 100644
--- a/Geo/MElementCut.h
+++ b/Geo/MElementCut.h
@@ -238,6 +238,7 @@ class MPolygon : public MElement {
   virtual const polynomialBasis* getFunctionSpace(int order=-1) const
   {
     if (_orig) return _orig->getFunctionSpace(order);
+	return 0;
   }
   virtual void getShapeFunctions(double u, double v, double w, double s[], int o)
   {
diff --git a/Plugin/Distance.cpp b/Plugin/Distance.cpp
index 32c14b2147d79abe86bfe2cd27ecdf42a5dc84df..9bc823c5787b9162696bef129a1b6ba46b3e8a43 100644
--- a/Plugin/Distance.cpp
+++ b/Plugin/Distance.cpp
@@ -395,7 +395,7 @@ PView *GMSH_DistancePlugin::execute(PView *v)
       }
     }
   }  
-  int mid = (int)floor(allElems.size()/2);
+  int mid = (int)floor(allElems.size() / 2.);
   MElement *e = allElems[mid];
   MVertex *vFIX = e->getVertex(0);
   myAssembler.fixVertex(vFIX, 0, 1, 0.0);
diff --git a/Solver/groupOfElements.h b/Solver/groupOfElements.h
index 620d8ccb77307ea4c8819b4f371df83973ad0869..05b33c0d35fc1d73bc0b327f0b8547ec030866e8 100644
--- a/Solver/groupOfElements.h
+++ b/Solver/groupOfElements.h
@@ -102,7 +102,7 @@ class groupOfLagMultElements : public groupOfElements
 
   void fillElementContainer(groupOfElements &pElem, groupOfElements &sElem)
   {
-    groupOfElements::elementContainer::iterator itp = pElem.begin();
+    groupOfElements::elementContainer::const_iterator itp = pElem.begin();
     for (;itp!=pElem.end(); itp++)
     {
       if ((*itp)->getParent())