Fix fatal errors when logging is disabled