Bail out early when index is larger than range or vector.