Updated the handling of SVG events