Correctly store error count