Correction of a minor bug on the cycle removal function.