diff --git a/include/gmsh_io.h b/include/gmsh_io.h
index 8d63a7576f8850d0b14a041b8214f5b59bcd626f..fd7f5c88e6ea62a7fe3889602d25879033774cb4 100644
--- a/include/gmsh_io.h
+++ b/include/gmsh_io.h
@@ -198,7 +198,10 @@ public:
 
     int entity_rank(int tag) const
     {
-        return partition_inverse_map.at(tag)-1;
+        if (num_partitions > 1)
+            return partition_inverse_map.at(tag)-1;
+        
+        return 0;
     }
 
     entity&         entity_world_lookup(int);
diff --git a/src/maxwell_cpu.cpp b/src/maxwell_cpu.cpp
index 942b9cd8d0b3e597e11a5ef2769b3ac587f74cb8..04911512ea37fe235e60a41dc94ed74b69a5d4a4 100644
--- a/src/maxwell_cpu.cpp
+++ b/src/maxwell_cpu.cpp
@@ -635,7 +635,6 @@ gather_field(const model& mod, maxwell::field& in, maxwell::field& out,
         }
     }
 }
-#endif
 
 void
 export_fields_to_silo_2(const model& mod, maxwell::solver_state& state,
@@ -691,6 +690,7 @@ export_fields_to_silo_2(const model& mod, maxwell::solver_state& state,
         gather_field(mod, state.emf_next, dummy, 0, MPI_COMM_WORLD);
     }
 }
+#endif /* USE_MPI */
 
 void
 export_fields_to_silo(const model& mod, const maxwell::solver_state& state,
diff --git a/src/maxwell_solver.cpp b/src/maxwell_solver.cpp
index 9653c9ba196871876dc42f666a703199771b3998..a4d7480ed2048ab236dea54f5dfd712ff0185909 100644
--- a/src/maxwell_solver.cpp
+++ b/src/maxwell_solver.cpp
@@ -221,12 +221,12 @@ void test_it(const model& mod, State& state, maxwell::parameter_loader& mpl)
         do_sources(mod, state, mpl);
         
 #ifdef USE_MPI
-        //int rank;
-        //MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-        //if (rank == 0)
-#endif /* USE_MPI */
             if ( (silo_output_rate != 0) and (i%silo_output_rate == 0) )
                 export_fields_to_silo_2(mod, state, mpl);
+#else
+            if ( (silo_output_rate != 0) and (i%silo_output_rate == 0) )
+                export_fields_to_silo(mod, state, mpl);
+#endif /* USE_MPI */
 
         swap(state, mpl);