fixes for menus being attached to multiple buttons/windows (John Fay)