Fixing some error handling issues

Please run your source through `gofmt`.