During his recent visit to South Korea, President Trump took another swipe at the free-trade agreement between the U.S. and South Korea. Good for him. Good for America. Ultimately, good also for South Korea.

President Trump and his South Korean counterpart, Moon Jae-in, instructed their negotiators to “conclude an improved agreement expeditiously.”

The South Koreans had already agreed to concessions after the trade deal, known as Korus, was first signed. Nonetheless, President Trump has not been happy with it.

In April, President Trump said the trade deal was “horrible” and had “destroyed” America. In September, the president ordered his staff to prepare a withdrawal. In Seoul, the trade pact was high on his crowded agenda with President Moon.

President Trump had many reasons to talk about the trade agreement. Korus has been a sweet deal for South Korea, and there were analysts calling for the U.S. to withdraw from it, largely because the pact has appeared to increase America’s trade deficit with the South.

In 2011, the year before Korus became effective, the U.S. merchandise trade deficit with South Korea was $13.2 billion. Last year, the deficit had ballooned to $27.6 billion.

Services trade reduced the overall deficit, but not by much. The U.S. had a surplus with the South in 2011 in services of $6.9 billion. Last year, that surplus increased to $10.7 billion.

This year, as Wendy Cutler points out, America’s trade deficit with South Korea has been steadily getting smaller. The trend, she notes in The Hill, leaves South Korea “scratching its head on why it’s being singled out.”

South Koreans should scratch no more. For one thing, President Trump raised trade concerns on every stop of his five-nation visit to Asia. South Korea was by no means the only trader in his sights.

Moreover, Korus was considered a prime target. Analysts argue about the effect of the agreement on the trade in goods and services. But beyond dispute is the fact that South Korean administrative agencies, under Moon and his predecessors, have severely disadvantaged American competitors.

Especially egregious was the assault on San Diego-based Qualcomm by the horribly misnamed Korea Fair Trade Commission.

Whatever the merits of the commission’s 1.03 trillion won ($912.3 million) fine and its forced-licensing regime, the agency refused to give to Qualcomm important procedural protections that Korus guarantees to American companies.

That outrageous denial has fueled concern about Seoul’s trade practices in general. “Korus is useless if an administrative agency can just ignore it,” wrote John Shu, who served in both Bush administrations, in September.

So the South Korean leader has been on the defensive. “President Moon and his senior staff surely understand how bad it would look if the South Korean government, under his leadership, were to continue misusing its administrative agencies to benefit South Korean companies and to harm American companies and their competitiveness,” Shu wrote in late June.

Korus currently contains only ineffective enforcement mechanisms, mostly consultation provisions. The issue for some observers is whether there is any possible fix.

“These mechanisms are far from adequate for the same reasons that trade deals with Asian mercantilists make no sense,” Alan Tonelson, a trade expert in the Washington area, recently told the American Conservative Union in e-mailed comments. “Their pervasive non-tariff barriers, created by agile, secretive bureaucracies, are excruciatingly difficult to detect and document, much less reduce or eliminate.”

Washington can file claims with the World Trade Organization when Korus violations also look like violations of WTO rules. WTO panels can hand down enforceable rulings. However, the global trading body imposes no penalties for violations until a decision has been issued, by which time a company like Qualcomm can be irrevocably injured.

Because the WTO’s dispute-resolution procedures are so inadequate, experts have been thinking of unilateral solutions to remedy the flaws in America’s trade pacts.

Tonelson, who blogs at RealityChek, argues “the only sensible approach for Washington in these cases is exiting such agreements, and unilaterally establishing the bilateral terms of trade, including setting up the U.S. as judge, jury, and court of appeals for disputes.”

For most trade mavens, that solution looks too drastic, but it makes Seoul’s officials nervous. They have countered President Trump’s call for renegotiation by arguing that South Korean investment into the U.S. has created employment.

Cutler, who negotiated Korus for Washington, pointed out in comments to the Washington Post that inbound South Korean investment in 2016 set a record. That investment, she noted, “has resulted in tens of thousands of high-paying U.S. jobs” and that the trend of increasing investment probably will not continue if the U.S. ditches Korus.

Cutler may be wrong. South Korean companies might decide to invest even more in the U.S. to avoid tariff and other barriers that might be erected after a termination of the free-trade agreement.

The problem for South Korea is that Korus now looks so one-sided that the U.S., apart from geopolitical issues, has little stake in the success of the South Korean economy. That economy remains closed, Tonelson argues, so that virtually no U.S. supply chains would be disrupted by a termination of the trade deal.

There are times, however, when geopolitical concerns outweigh trade ones.

“North Korea is provoking and China is expanding their power, flexing muscles,” said Choi Seok-young, who negotiated Korus for South Korea. “We don’t quite understand what is the main purpose of Mr. Trump attacking Korea by terminating the Korea-U.S. FTA (free trade agreement) at this critical time.”

The purpose, of course, would be to protect American intellectual property, which is the source of strength of the American economy and therefore the underpinning of the military might that enables the U.S. to defend, among others, South Korea. It is, consequently, in the South’s long-term interest to offer a Korus fix to tighten the links between the two allies.

As Shu sensibly points out: “The better our economic relationship is, the better our strategic relationship will be.”