BUG: IOerror: Only output to IOerror to stream if the stream is not bad