various fixes to the function to rename collections