Fixed a bug with error and warning state count

Change-Id: I79495ecee3816737e9c31768af6c210906e136eb