Fix hasErrors check