Check some errors

Discovered by https://github.com/kisielk/errcheck
Merge pull request #173 from Shopify/errcheck-1

Check some errors