Fix bug with ZeroDivisionError thrown when calculating proportions