Kludgey workaround for menu positioning, not satisfactory yet.
Added a few failsafes