Bug fixes, ported xdgmenu from legacy alan.