Fix statistics code after merge