Improved error reporting in return status