Fix: possible bound exception when debugging(totalview). Variable jsl=0 is evaluated in do while. Code refactored.