Added checks for subtraction and division.