Fix the issue where current_nr_timesteps can become 0, causing the kernel to run indefinitely.
current_nr_timesteps