Fixed error in Safari, where .children really is only defined on HTML elements and is not available for SVG.