Fixed a bug with the show/hide of a menuitem.