Free used memory:

* Copy and free strings.
* Clean up created nodes