fixed a bug in reptend introduced when renaming variables