Fixing infinite loops on Renaming elements