Fix err check.