Fix bugs with popover