Issue #106: apply @dscho'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.