Return Go errors instead of ints