Fixed some major bugs in the menufunctions