Fix potential logging problems