Added two tests to ensure that cycle detection has no negative side
effects.