Optimize option $StartIndex handling