Changed the error codes to be based on variables with meanings.