Fixed bugs in stat reporting.