Fixed some nullpointer in smelting.