Fixed positive infinity bug that can occur in specific scenarios when score mode average is used.

Closes #4291