Fixed some popover and modal layout and bugs.