Fix string index errors.