Add some error checking for read_io.