Fixed clearErrors bug