Fix error handling to work with Go 1.0.

Happy new year!

Some minor fixes I needed to build with go1.0.3.  Enjoy!