Refinements to svg rendering and some fixes