This isn't entirely accurate. Instead what you encountered was an integer overflow, which has a similar result but different methodology. Say if I had 725 widgets, when I complete the quest I have 750, so clearly it's not widget=25. Instead, what occurs is that the game rolls over the integer of 999 to 025, because 1000 doesn't exist in its logic. The moral here is that if you have widgets, SPEND THEM!