Fix log mode in scripting.