Free unique id
Unreference date time
Free caps, remove strdup
Merge branch 'master' into plugins