Fixes #8: Resource leak