fixed other cases where divisors can be zero