Fix small bug about invalid/null references in log file