Fixed NBT reading, minor changes