Fixing a NPE