Fixed replacement bug with children.set(...). Fixed bug with replaceWith which removed all elements event listeners.