Fixed a bug that causes type-checking arithmetic expressions to loop