Had to make amendments. Was not setting returnNameFormatAsKey early enough. Also was converting group names, which it shouldn't - fixed