fix various sorting, menu tree bugs
Merge branch 'fix-menu-bugs' into 2.1