NPE's in files and ItemStack errors fixed.