Fixed bug #14143: count_menuItems not working correctly