Removed single node bug in cycle detection.