diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp
index 3361f31aff4103b90204c89024bff513768973e7..f3411af95287753111e486d8471466d184a0a57a 100644
--- a/Geo/GFaceCompound.cpp
+++ b/Geo/GFaceCompound.cpp
@@ -1127,12 +1127,13 @@ bool GFaceCompound::parametrize_conformal_spectral() const
 #if !defined(HAVE_PETSC) && !defined(HAVE_SLEPC)
 {
 
- Msg::Error("-----------------------------------------------------------------------------!");
- Msg::Error("Gmsh should be compiled with petsc and slepc for using the conformal map     !");
- Msg::Error("Switch to harmonic map or see doc on the wiki for installing petsc and slepc !");
- Msg::Error("https://geuz.org/trac/gmsh/wiki/STLRemeshing (username:gmsh,passwd:gmsh)     !");
- Msg::Error("-----------------------------------------------------------------------------!");
- Msg::Exit(1);
+  Msg::Error("-----------------------------------------------------------------------------!");
+  Msg::Error("Gmsh should be compiled with petsc and slepc for using the conformal map     !");
+  Msg::Error("Switch to harmonic map or see doc on the wiki for installing petsc and slepc !");
+  Msg::Error("https://geuz.org/trac/gmsh/wiki/STLRemeshing (username:gmsh,passwd:gmsh)     !");
+  Msg::Error("-----------------------------------------------------------------------------!");
+  Msg::Exit(1);
+  return false;
 
 }
 #else
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index 7ebaccaf333e1ad38af50934290d921d91488eb2..5a9a5d9cfe3dc09901777992e00395e1cf14cf5b 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -1653,7 +1653,9 @@ FieldManager::FieldManager()
 {
   map_type_name["Structured"] = new FieldFactoryT<StructuredField>();
   map_type_name["Threshold"] = new FieldFactoryT<ThresholdField>();
+#if defined(HAVE_ANN)
   map_type_name["BoundaryLayer"] = new FieldFactoryT<BoundaryLayerField>();
+#endif
   map_type_name["Box"] = new FieldFactoryT<BoxField>();
   map_type_name["Cylinder"] = new FieldFactoryT<CylinderField>();
   map_type_name["LonLat"] = new FieldFactoryT<LonLatField>();