`insertFunction` now behaves correctly if `selector` argument is a DOM node