Fix divide by zero error