a bunch of fixes to make unit tests work