Fixed some bugs and added some improvements to menuedit (issue #163 and #136)