I tested it, and I always get it to reset correctly when touching the ground. However, it doesn't reset when you touch a wall... I'll fix that on the next update. And, for simplicity, instead of adding another option to make it infinite, I'll simply allow for a ridiculously high number.
I'll wait a bit in case something else comes up.
Edit: nvm, if you jump really fast it doesn't always reset in the ground either. I'll fix that too.