Fixed bug where sub-menus were being hidden unintentionally