Added support for circular dependencies in asDictionary method.