Fix bug where menu command invoke only closed current submenu, and not the entire cascade.