Change where renaming happens, to fix the repeated-variable case.