Corrected divide by zero error