Fixes undefined index warnings when using custom menus.