Logging and null guard.