small bugs in stats calc