Added support for circular references in isSubset()