Fix file-handle leak
Merge pull request #123 from justfalter/fix_leaky_handles

Fix file-handle leak