Fixed problem where popups don't toggle properly if a DOM sub-element is removed during their lifetime.