fixed a cast problem in the calculator.