Fix renaming in-place bug with virtual variables

This is why mutating state is a bad idea.
Merge pull request #201 from shoyer/bug-fixes

Fix renaming in-place bug with virtual variables