diff --git a/Geo/CustomContainer.h b/Geo/CustomContainer.h
index 5f6ac7d6068c90e06919ea31dc089f7ccb20c1a4..734e60853d6f87cd82e05217e8b25ab91dd5ea8b 100644
--- a/Geo/CustomContainer.h
+++ b/Geo/CustomContainer.h
@@ -173,7 +173,7 @@ class Block
   // Destructor
   ~Block()
   {
-    free(array);
+    std::free(array);
   }
 
   friend class Pool<T>;
diff --git a/Geo/GModelIO_CGNS.cpp b/Geo/GModelIO_CGNS.cpp
index 7e589938e6b448d8c20448ad10922ab4b2157805..9405c8153acf567da2cc9a0c0d3e8826434f1a87 100644
--- a/Geo/GModelIO_CGNS.cpp
+++ b/Geo/GModelIO_CGNS.cpp
@@ -5,6 +5,11 @@
 //
 // GModelIO_CGNS.cpp - Copyright (C) 2008 S. Guzik, C. Geuzaine, J.-F. Remacle
 
+#include "GModel.h"
+#include "Message.h"
+
+#if defined(HAVE_LIBCGNS)
+
 #ifdef _OPENMP
 #include <omp.h>
 #else
@@ -24,14 +29,10 @@
 #include <vector>
 #include <queue>
 
-#include "GModel.h"
-#include "Message.h"
 #include "MZone.h"
 #include "MZoneBoundary.h"
 #include "CGNSOptions.h"
 
-#if defined(HAVE_LIBCGNS)
-
 #include <cgnslib.h>
 
 //--Error function for the CGNS library
diff --git a/Geo/MZone.cpp b/Geo/MZone.cpp
index 6391e70b762509118f2e2a27bd1a527cca7679e2..635a8f96d8459a71c3fe3d674f339487dda0556e 100644
--- a/Geo/MZone.cpp
+++ b/Geo/MZone.cpp
@@ -5,6 +5,8 @@
 //
 // MZone.cpp - Copyright (C) 2008 S. Guzik, C. Geuzaine, J.-F. Remacle
 
+#if defined(HAVE_LIBCGNS)
+
 #include <iostream> // DBG
 #include "MZone.h"
 
@@ -341,3 +343,5 @@ template void MZone<2>::add_elements_in_entity
 template void MZone<3>::add_elements_in_entity
 <GRegion*>
 (GRegion* entity, const int partition);
+
+#endif
diff --git a/Geo/MZoneBoundary.cpp b/Geo/MZoneBoundary.cpp
index 2b234892a6f09359722dfcc27db3e76d63e563c1..35883fefcd0afc61d3bf6c9555a9be8de5601173 100644
--- a/Geo/MZoneBoundary.cpp
+++ b/Geo/MZoneBoundary.cpp
@@ -5,6 +5,8 @@
 //
 // MZoneBoundary.cpp - Copyright (C) 2008 S. Guzik, C. Geuzaine, J.-F. Remacle
 
+#if defined(HAVE_LIBCGNS)
+
 #include <iostream> // DBG
 #include <limits> // ?
 
@@ -921,3 +923,5 @@ MZoneBoundary<3>::GlobalVertexData<MFace>::FaceDataB::FaceDataB()
 
 template class MZoneBoundary<2>;
 template class MZoneBoundary<3>;
+
+#endif