Improve test cleanup