Added GetCurrentParameterIndex helper method.