Added event counting.