Improved the robustness of the cyclic detection algorithm. Closes #78