Add mode checking to MenuItem. ref #129