Fix resource leak
Merge branch '0.1'