Fixed most test failures