Add more error API verbosity

We now report errors when the return code is returned via a integer
argument to function, even if that pointer is null.