Fix text nodes not properly removing in safari.