Added better error reporting in the core and as part of the ABI