Fixing a couple of NPE