Added new fields for better error reporting.
Updated the result codes returned.
Updated the types of result codes that could be returned.