Check return code