Fixed some errors in the menus package which could occur during a map change