Insert defs into svg element, not before it

Change-Id: Ic8b56b9d0d854d8a58f6e6b063262dbf3525c809