Fixed the bug causing type-checking arithmetic expression to loop