Fix resource leaks.
Merge branch 'master' into release