Diagram to SVG enhancements and stabilization