Added type checking for relational operators.