Fixed bug in GetCurrentParameterIndex + added unit tests for this
function.