diff --git a/MooreOnlineConf/options/online.py b/MooreOnlineConf/options/online.py
index bfba16c2058145a7c8c9d8d5f15f19f986a4a086..ebc04d43d4bec9c72b9bc7d55466d78f5bbf29ba 100644
--- a/MooreOnlineConf/options/online.py
+++ b/MooreOnlineConf/options/online.py
@@ -85,8 +85,9 @@ else:
     # all events if it can't process fast enough. However, for testing we
     # use "ONE" so that the reader does not keep on pumping events when
     # they are not consumer (i.e. a debugger is attached).
-    input_mbm_user_type = ("USER" if OnlineEnv.PartitionName.startswith("TEST")
-                           else "ONE")
+    input_mbm_user_type = "USER"
+    if OnlineEnv.PartitionName.startswith("TEST"):
+        input_mbm_user_type = "ONE"
 
 if task_type == "HLT2":
     application.config.events_LowMark = 1000
diff --git a/MooreScripts/python/MooreScripts/testbench/asyncdim.py b/MooreScripts/python/MooreScripts/testbench/asyncdim.py
index 1faf852a9ba5dbec25bf96351b56bcd819c671d7..1ade163a3d905f522e4c82ece1e3e76bede209d6 100644
--- a/MooreScripts/python/MooreScripts/testbench/asyncdim.py
+++ b/MooreScripts/python/MooreScripts/testbench/asyncdim.py
@@ -16,10 +16,18 @@ https://lhcbdoc.web.cern.ch/lhcbdoc/pydim/guide/index.html
 """
 import asyncio
 import logging
-import pydim
+import os
 import random
+import sys
 import datetime
 
+# Before importing pydim, we need to set LD_PRELOAD, which is set in case
+# pydim was built with sanitizers.
+if not os.getenv("LD_PRELOAD") and (san := os.getenv("PRELOAD_SANITIZER_LIB")):
+    os.environ["LD_PRELOAD"] = san
+    os.execv(sys.argv[0], sys.argv)
+import pydim  # noqa
+
 log = logging.getLogger(__name__)
 
 _DIM_MESSAGE_LEVELS = {
diff --git a/MooreScripts/scripts/get_hlt1_data.py b/MooreScripts/scripts/get_hlt1_data.py
index 61988a78c56ed53fff7dfa8048bdb923c71d2945..806d3cddd0504aaf8b7d81b379f55bc8e1c57d05 100755
--- a/MooreScripts/scripts/get_hlt1_data.py
+++ b/MooreScripts/scripts/get_hlt1_data.py
@@ -16,7 +16,10 @@ import sys
 import urllib.request
 
 # unset proxy in case it is set
-del os.environ["http_proxy"]
+try:
+    del os.environ["http_proxy"]
+except:
+    pass
 
 
 def dir_path(s):
@@ -86,4 +89,3 @@ try:
         dest_part.rename(dest)
 except KeyboardInterrupt:
     dest_part.unlink()
-
diff --git a/MooreScripts/scripts/testbench.py b/MooreScripts/scripts/testbench.py
index 8e6ed95b265bf9111bee18f7837ecf81f404aed5..e595bb5f4667fc260701d52f15a2afcb0004873a 100755
--- a/MooreScripts/scripts/testbench.py
+++ b/MooreScripts/scripts/testbench.py
@@ -196,7 +196,12 @@ async def main():
             await tasks_wait_for_status(tasks, "OFFLINE")
 
             # Wait for the tasks to close
-            print(await tasks_wait_for_exit(tasks))
+            exit_codes = await tasks_wait_for_exit(tasks)
+            if set(exit_codes) != {0}:
+                for t, ec in zip(tasks, exit_codes):
+                    if ec != 0:
+                        log.error(f"{t.utgid} exited with non-zero code {ec}")
+                return 102
 
     except asyncio.CancelledError:
         log.warning("Event loop was cancelled")
diff --git a/cmake/MooreOnlineDependencies.cmake b/cmake/MooreOnlineDependencies.cmake
index 769040740f65215043bfce938284c547a3f769cb..2a4e8247c7a77edab979dd61ea5cc676c2ba0737 100644
--- a/cmake/MooreOnlineDependencies.cmake
+++ b/cmake/MooreOnlineDependencies.cmake
@@ -38,8 +38,9 @@ pkg_check_modules(sodium libsodium REQUIRED IMPORTED_TARGET)
 # -- Private dependencies
 if(WITH_MooreOnline_PRIVATE_DEPENDENCIES)
     find_package(Python REQUIRED Interpreter)
-
     find_package(MPI QUIET COMPONENTS C CXX)
+    find_package(cppgsl REQUIRED)
+    find_package(Boost REQUIRED program_options)
 
     pkg_check_modules(hwloc QUIET IMPORTED_TARGET hwloc)
 endif()