Fix issue with counting in CountEventsSource