Error codes returned make more sense.

Previously, returned codes where tv4 numbers making it impossible to understand
what was meant. Now, they are the corresponding error values.