bug fixes to stats