Fix a bug in the crafting reward calculation script.