Fix menu tree generation