Fix for random menu item deallocation