Fixes to allow unit tests to run fully