Better aggregate statistics and fixed bugs in latency
calculation/testing. Messy commit.