Fix handling of submenus in conversion of legacy context menu format