Style fixes

sponsored by [golint](https://github.com/golang/lint)
How does this change behavior? It was already not closing the file in the old version. Or am I missing something?