Cycle bug fixed
Empty string can finish now, new test cases