Fix a bug and a test
Add strong typing for rename