Add cycle detection and creation.