Fixed crash when removing submenus in WPrefs' menu editor.