Remove error div if replaced by a popover

Avoid a unwanted margin under the div.