Fix most test failures