Correct index errors.