diff --git a/MathLib/KelvinVector-impl.h b/MathLib/KelvinVector-impl.h
index 967149b8c7735bdfe4be2978f823cbc99967947a..7a860b8869dcf3a3d97db53701644e04f6f00816 100644
--- a/MathLib/KelvinVector-impl.h
+++ b/MathLib/KelvinVector-impl.h
@@ -69,7 +69,7 @@ double Invariants<KelvinVectorSize>::trace(
 // Initialization of static Invariant variables.
 //
 
-namespace detail
+namespace KelvinVector_detail
 {
 template <int KelvinVectorSize>
 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
@@ -108,17 +108,17 @@ Eigen::Matrix<double, KelvinVectorSize, 1> initIdentity2()
 template <int KelvinVectorSize>
 const Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
     Invariants<KelvinVectorSize>::deviatoric_projection =
-        detail::initDeviatoricProjection<KelvinVectorSize>();
+        KelvinVector_detail::initDeviatoricProjection<KelvinVectorSize>();
 
 template <int KelvinVectorSize>
 Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> const
     Invariants<KelvinVectorSize>::spherical_projection =
-        detail::initSphericalProjection<KelvinVectorSize>();
+        KelvinVector_detail::initSphericalProjection<KelvinVectorSize>();
 
 template <int KelvinVectorSize>
 const Eigen::Matrix<double, KelvinVectorSize, 1>
     Invariants<KelvinVectorSize>::identity2 =
-        detail::initIdentity2<KelvinVectorSize>();
+        KelvinVector_detail::initIdentity2<KelvinVectorSize>();
 
 }  // namespace KelvinVector
 }  // namespace MathLib
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 46cb824af5a218473cf1e14bcc508b46df67dab6..546c2e2d20d249b94277beb394e3f24fc2232e83 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -15,7 +15,11 @@ append_source_files(TEST_SOURCES MaterialLib)
 append_source_files(TEST_SOURCES MathLib)
 append_source_files(TEST_SOURCES MeshLib)
 append_source_files(TEST_SOURCES MeshGeoToolsLib)
-append_source_files(TEST_SOURCES NumLib)
+append_source_files(TEST_SOURCES_NUMLIB NumLib)
+# Disable Unity build for NumLib tests
+set_source_files_properties(${TEST_SOURCES_NUMLIB} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Keep order of source files, otherwise PETSc non-MPI tests fail
+set(TEST_SOURCES ${TEST_SOURCES} ${TEST_SOURCES_NUMLIB})
 append_source_files(TEST_SOURCES ParameterLib)
 append_source_files(TEST_SOURCES ProcessLib)
 
diff --git a/Tests/MathLib/TestODESolver.cpp b/Tests/MathLib/TestODESolver.cpp
index d9d0ec8ae61b1748091e70e9b46e3283576d5c80..cf719b5025f879f75cfcee2b91e56a34f6ed6f93 100644
--- a/Tests/MathLib/TestODESolver.cpp
+++ b/Tests/MathLib/TestODESolver.cpp
@@ -13,6 +13,8 @@
 #include "BaseLib/ConfigTree.h"
 #include "MathLib/ODE/ODESolverBuilder.h"
 
+namespace TestODESolver {
+
 const double abs_tol = 1e-8;
 const double rel_tol = 1e-8;
 
@@ -315,3 +317,5 @@ TEST(MathLibCVodeTest, ExponentialWithJacobianNewton)
         check(time_reached, y[0], y_dot[0], time, y_ana, y_dot_ana);
     }
 }
+
+} // end namespace
diff --git a/Tests/NumLib/TestODEInt.cpp b/Tests/NumLib/TestODEInt.cpp
index aa91edc15291236f871b7de898ae1e9b5072f913..5740221277dbc10ddad3af7db88f374aaba9b8d7 100644
--- a/Tests/NumLib/TestODEInt.cpp
+++ b/Tests/NumLib/TestODEInt.cpp
@@ -25,6 +25,8 @@
 
 #include "TimeLoopSingleODE.h"
 
+namespace TestODEInt {
+
 #ifndef USE_PETSC
 std::unique_ptr<GlobalLinearSolver>
 createLinearSolver()
@@ -298,3 +300,5 @@ TYPED_TEST(NumLibODEIntTyped, DISABLED_T1)
  * * check that the order of time discretization scales correctly
  *   with the timestep size
  */
+
+} // end namespace
diff --git a/scripts/cmake/UnityBuildSettings.cmake b/scripts/cmake/UnityBuildSettings.cmake
index a88a922199e78c84dff87faa148f0795216fd4fc..c469531a0f3fd9b299c439992b7ea102830beb8a 100644
--- a/scripts/cmake/UnityBuildSettings.cmake
+++ b/scripts/cmake/UnityBuildSettings.cmake
@@ -10,7 +10,5 @@ set_target_properties(MeshLib PROPERTIES UNITY_BUILD_BATCH_SIZE 20)
 # set_target_properties(ProcessLib PROPERTIES UNITY_BUILD_BATCH_SIZE 80) # breaks!
 
 if(TARGET testrunner)
-    # breaks!
-    # set_target_properties(testrunner PROPERTIES UNITY_BUILD ON)
-    # set_target_properties(testrunner PROPERTIES UNITY_BUILD_BATCH_SIZE 2)
+    set_target_properties(testrunner PROPERTIES UNITY_BUILD ON)
 endif()