Various fixes to make the tests/refactors run