Improve test failure clean up