Corrected NPE logging issues