Circular dependency detection