Magnetize was horribly broken. Again.

Also, if ArrayCreate is passed an existing array, it is freed first so the
memory isn't leaked before resetting the fields and making a new one.