Handle popover in addition to tooltip
Fix SQL syntax issue