Change function return types to prefer generic error interface.