Issue #106: apply @dsho's suggested change.

With the suggested change, IT's pass, no funny files.

I also added a try/finally around the file stream, because I am just compulsive that way.

closes #106.