Fix renaming in-place bug with virtual variables

This is why mutating state is a bad idea.