Fixed inconsistency with error handling in the arithmetic operations.