Fix situation where submenu was displayed whether it was empty or not