Performance upgrades for inner-loop stats(), almost 30% faster.