Nearly fixed all the tests.