Changed calculation of statistics.