Fix error handling to work with Go 1.0.
Merge pull request #8 from tsuna/master

Fix error handling to work with Go 1.0.