A lot of changes to make the tests work.