Stocks are soaring, and consumer confidence is higher than it’s been in 18 years, thanks in part to the Trump administration’s aggressive renegotiation of outdated U.S. trade deals. Its latest push to modernize NAFTA has been particularly well-received by the market.

In response to an announcement that the U.S. and Mexico had reached a preliminary bilateral trade deal, both the S&P 500 and Nasdaq indexes rose to new heights. That’s a good sign that investors, many of whom have been leery about the prospects of a looming trade war, are coming off the sidelines.

All of this reflects well on the administration’s effort to restructure the almost 25-year old agreement. But that’s not to say every detail is perfect.

Some of the provisions in the agreement still need work. Instead of moving the country toward freer trade with fewer barriers, they do the opposite. Take the auto industry for example: To qualify for tariff-free treatment under the agreement, automakers will be required to produce 75 percent of their parts in the U.S. and Mexico. Under the old arrangement, that requirement was 62.5 percent. Pushing the threshold higher could mean slower production times as new facilities are built or existing ones expanded. It could also mean higher prices as cheaper parts that are used now get displaced.

Another provision would require automakers to pay roughly half of their workforce a minimum of $16 per hour. Presumably, this was included to assuage concerns that some businesses were relocating their facilities to areas outside of the U.S. to benefit from lower labor costs. Whatever the reason, this requirement could well push up prices.

If the new agreement forces automakers and their suppliers to raise prices, then that will likely mean fewer sales. And that would come at a tough time for automakers who are already seeing higher interest rates spook sales.

There are positive elements to be encouraged about, too, such as prohibiting tariffs on digital products and preserving much of the original deal’s free trade in agriculture. Too, the proposal promises to leave in place some important assurances for a skeptical energy sector.

In 2013, outgoing Mexican President Enrique Peña Nieto started to slowly privatize the country’s energy sector, which had long been in state control — and, as is the case with all government-run monopolies, had grown uneconomical. As Nieto’s changes gradually took hold, the country benefitted from an uptick in foreign investment that prominently included petroleum companies in Texas and the U.S.

As American companies stepped-in with the necessary human and financial capital, both countries benefitted. The investment allowed Mexico to produce and sell greater amounts of crude oil while, in turn, the U.S. was able to sell back more refined products. For both countries, this meant more job growth and human flourishing. And fortunately, much of this dynamic looks like it will be preserved under the new bilateral agreement.

If that arrangement can hold through any final agreement, then it will almost surely mean that American companies will continue doing investing in Mexico’s energy sector, which would of course be a boon to Texas.

Looking ahead, the administration should now turn its attention to improving the agreement by including Canada. The Great White North is America’s second-largest trading partner, behind only China. Establishing favorable trade policies with Canada is a must if the new NAFTA is to be an improvement over the old version.

Any good trade agreement should look to relax member countries’ tariffs, which are nothing more than taxes in disguise favoring special interests. Canada’s tariffs on dairy products are especially punitive, while the U.S. imposes high tariffs on beverages, tobacco and sugar.

If the administration can successfully negotiate a trade deal that both includes Canada and expands free trade, then today’s economic exuberance could last well into the future.