Fixes crafting js bug.