Got rid of the check_for_io_err code, as it could cause a hang.