diff --git a/Tests/Functional/Core/CMakeLists.txt b/Tests/Functional/Core/CMakeLists.txt
index 1881a49f5bcca9c6ba5374be4fdedda209e4940e..bb45938f28c271f21a5016f4aab5d0b6ecfe0288 100644
--- a/Tests/Functional/Core/CMakeLists.txt
+++ b/Tests/Functional/Core/CMakeLists.txt
@@ -3,7 +3,7 @@
 ############################################################################
 
 set(CORE_STD_OUT_DIR ${BUILD_REF_DIR}/StandardSuite)
-set(CORE_STD_REF_DIR ${REFERECNCE_DIR}/StandardSuite)
+set(CORE_STD_REF_DIR ${REFERENCE_DIR}/StandardSuite)
 set(CORE_SPECIAL_OUT_DIR ${BUILD_REF_DIR}/Special)
 
 # CoreStandardTest cases:
diff --git a/Tests/Functional/Core/CoreTest.cpp b/Tests/Functional/Core/CoreTest.cpp
index 8ae92ade558b9233d3a14bbb3caa14c9d79cb102..64df4fb55ba6d3294cc382b845962bb10f64ff4c 100644
--- a/Tests/Functional/Core/CoreTest.cpp
+++ b/Tests/Functional/Core/CoreTest.cpp
@@ -20,6 +20,7 @@
 #include "IntensityDataIOFactory.h"
 #include "TestConfig.h"
 #include "Utils.h"
+#include <cassert>
 
 CoreTest::CoreTest(
     const std::string& name, const std::string& description, GISASSimulation* simulation,
@@ -39,11 +40,10 @@ CoreTest::~CoreTest()
 
 void CoreTest::runTest()
 {
-    if (!m_simulation)
-        throw Exceptions::NullPointerException(
-            "CoreTest::runTest() -> Error. Uninitialized simulation object.");
+    assert(m_simulation);
     m_simulation->runSimulation();
 
+    assert(CORE_STD_REF_DIR!="");
     m_ref_filename = CORE_STD_REF_DIR + "/" + getName() + ".int.gz";
     try {
         m_reference = IntensityDataIOFactory::readOutputData( m_ref_filename );
diff --git a/Tests/Functional/TestMachinery/CMakeLists.txt b/Tests/Functional/TestMachinery/CMakeLists.txt
index de59f6cc4bcfb7689cd852ef6d8ea6a97b87d795..e19a7300f2437a54f0e3f7607187883c0e082a63 100644
--- a/Tests/Functional/TestMachinery/CMakeLists.txt
+++ b/Tests/Functional/TestMachinery/CMakeLists.txt
@@ -9,6 +9,8 @@ if(POLICY CMP0042)
 endif()
 
 # --- source and include files ---------
+configure_file(TestConfig.h.in ${BUILD_INC_DIR}/TestConfig.h @ONLY)
+
 set(include_dirs ${BUILD_INC_DIR} ${CORE_SOURCE_DIRS} ${GSL_INCLUDE_DIR}
     ${CMAKE_SOURCE_DIR}/Fit/Parameters # for INamed.h
     ${CMAKE_SOURCE_DIR}/Fit/Utils
diff --git a/cmake/bornagain/scripts/TestConfig.h.in b/Tests/Functional/TestMachinery/TestConfig.h.in
similarity index 100%
rename from cmake/bornagain/scripts/TestConfig.h.in
rename to Tests/Functional/TestMachinery/TestConfig.h.in
diff --git a/cmake/bornagain/modules/BornAgainConfiguration.cmake b/cmake/bornagain/modules/BornAgainConfiguration.cmake
index beff3b825f30f9293bd85241c6d9aaaf7dd288bf..6003568c598b4e16119fd8557418990772775fab 100644
--- a/cmake/bornagain/modules/BornAgainConfiguration.cmake
+++ b/cmake/bornagain/modules/BornAgainConfiguration.cmake
@@ -130,7 +130,6 @@ endif()
 
 configure_file(${TEMPLATE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake)
 
-configure_file(${TEMPLATE_DIR}/TestConfig.h.in ${BUILD_INC_DIR}/TestConfig.h @ONLY)
 configure_file(${TEMPLATE_DIR}/BAPython.h.in ${BUILD_INC_DIR}/BAPython.h @ONLY)
 configure_file(${TEMPLATE_DIR}/BAVersion.h.in  ${BUILD_INC_DIR}/BAVersion.h @ONLY)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${BUILD_INC_DIR}")