Fixed #416. More flexible menu system