Added validation for ArithmeticException exception.