Make menu_subtree compatible with names

(cherry picked from commit cc5d94ebaa66e127feea52002bb5a78b937c66b1)