Merge pull request #11402 from Pokechu22/too-many-indices IndexGenerator: Fix off-by-one in GetRemainingIndices