Fixed a bug in refreshVar/Type
Fixed a bug in refreshVar/Type

When refreshing variables, it is important that multiple occurrences of the same
variable get refreshed to an identical new variable.

PipocaQuemada/ermine,ekmett/ermine