Remove error div if replaced by a popover

Avoids an unwanted margin under the div.