Fixed null pointer exception in logging.