Added protection against circular dependencies