Fixed leaks
Fixed freeing lists
Merge branch 'master' into xep-0223