Fix bug where SVG output would sometimes have extra </g> tag
Merge branch 'bugfix/svg_XML_tag_mismatch'