diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp
index ec453a6abb4e2f859b2c031d24a3c2096e0d3783..673be6a20ed752ad9a9a2a8d7f216069de7af20a 100644
--- a/Geo/GModelIO_Mesh.cpp
+++ b/Geo/GModelIO_Mesh.cpp
@@ -578,8 +578,12 @@ static int getNumElementsMSH(GModel *m, bool saveAll, int saveSinglePartition)
   int n = 0;
   for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it)
     n += getNumElementsMSH(*it, saveAll, saveSinglePartition);
-  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it)
+  for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it){
     n += getNumElementsMSH(*it, saveAll, saveSinglePartition);
+    for(unsigned int i = 0; i < (*it)->lines.size(); i++)
+      if((*it)->lines[i]->ownsParent())
+        n += (saveAll ? 1 : (*it)->physicals.size());
+  }
   for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it){
     n += getNumElementsMSH(*it, saveAll, saveSinglePartition);
     for(unsigned int i = 0; i < (*it)->polygons.size(); i++)