Fixed cycle detection.

Now detects the cycles reported by @retronym