Fixed index type-errors.