Revert r173646, "Use proper type for the index."

Unfortunately, msvc miscompiles it. Investigating.