improve popover performance and other small fixes