Fix tests to fail on IO errors