Fixed crash in crafting (#1328).