Correctly detect errors in tests.