Enhance handling of circular references