Modify operator == and != in Term class