Fix wrong SvgScript.attach method and add test coverage