Now it's working.

At least it will check the numbers for correct numbers, and stops when
correct numbers are achieved. No more infinite loop due to logic error.