fix CSE bug with multiple adjacent replacements getting wrong indexes for the new vars