Hi, I found the problem: indeed when loading the patch there the index 0 is being written twice (only happens once when loading). To fix this, you need to add a [loadbang] before the [0( which resets your patch. Probably the time that it worked fine for you was when you manually banged this message before typing.
The explanation is this: when two patch cords come from the same outlet, the order in which the messages are emitted is identical to the order in which the patch cords were created. I believe you created the cords connected [select] to [f] last, meaning that the first bang arrives after the first key is written via [tabwrite], which will automatically start at 0. Thus the 2nd number you'll type will still be 0, and so on.
Try this patch here, which is identical to yours, but with the corrected [select] and added [loadbang] (since I also created those patch cords between [select] and [f] later). Does it run well for you? working-patch.pd
I hope this helps. Take care,
Gilberto