Fixed a bug in the NBT writer.