Improved statistics code and identified more problems.