More statistical collection code.