Sort out stats class and use in summary
Fix tests