Fix DOMfilter when replacing multiple occasions

Previously, it would sometimes forget things at the end