[BUGFIX] Ensure unique ids of nested menus

Fixes #624