Fixed global variable problem in SvgCanvas.