Correctly implements areSynonyms()