fix to unprocessed events count...

fix to unprocessed events count, is now decremented after event is
processed, tests also improved