Various little fixes to get the tests running (but not passing)