fixes a bug where we were consuming too many characters
js:
added a hack incase deltaForNumber returns 0
js