Added health counter and refactored error counter.