Fixed error count bug