Critical divide by zero fix