Fix self tests and SVG image output