Ensure file is closed by using with statement
Merge pull request #1 from svisser/patch-1

Ensure file is closed by using with statement.