Fixes for getting events count. Previously taking up massive amounts of memory.