Gradient fix

Additional fixes for toSVG method, importo of color alpha from rgba.
Fixed some error introduced with last commit.