Change the way to recover goodrepos in the cycle detector.