fix log and sh/dx ordering issues.