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