Followup to #336: Division by zero error in the calculation.