Updated prepareArgs from errmsg to name, add generic object code