Fix file corruption on Windows
Merge pull request #27 from osuchw/patch-1

Fix file corruption on Windows