Fixing an NPE