Fix failing unit tests on MacOS