Fix ArithmeticException