Fixed NBT, small code fixes.