fix some small regressions;
(@aurimasv - node.children doesn't catch text nodes. We need to use node.childNodes for that)