Improve compatibility with core-popup-menu