Fix reading past end of file with read_at