Fix a bug in context menus.