Improve test cleanup.