Circular reference detection