Modified errmessage to errcode, and errmsg