Fix a bunch of UnboundLocalErrors when the tests fail.
2 files changed