Fix for getElementByTagName invoked on Text node.