Fixed writing to NBT in readFromNBT.