Fixes undefined index warnings when using custom menus.

Solves issue #15.