Division by zero fix