Correct comments: pos must be < n_loc, not <=.