Free unique id
Unreference date time
Free caps, remove strdup
Merge branch 'master' into xep-0223