Fix error check in remote_read_bytes