Commodity stocks helped Canada's main stock index swing to a slight gain Wednesday after the market opened lower, while U.S. markets closed higher.

The early dip and reversal in equities came in part from global jitters around North Korea's threat to cancel denuclearization talks and a proposal from Italy to write down $250 billion in debt, said Jillian Bryan, senior vice-president at TD Wealth Private Investment Advice in Vancouver.

"It did slowly turn around here. I think the market always processes the information, takes a pause and then says oh, it's not such a big deal, life will go on, we'll figure out what's happening in Italy, we'll figure out what's going to happening Korea."

Finance Minister Bill Morneau's press conference Wednesday morning, where he announced the federal government would indemnify Kinder Morgan Inc.'s Trans Mountain expansion project, also helped turn the market around, said Bryan.

"I think that press conference was very well received, I think it was long overdue."

In the end, the Toronto Stock Exchange's S&P/TSX composite index closed up 10.25 points at 16,108.06, led by mining stocks but also boosted by energy companies.

Kinder Morgan Canada Ltd.'s share price, for one, ended up 33 cents or 1.97 per cent at $17.08.

Bryan said that uncertainty on the Trans Mountain project has, however, weighed on equities as it creates uncertainty for Canadian business investment.

"If you can't get a deal like this done in Canada, it says a lot about doing business in this country."

The climb in metal and crude stocks came as the June crude contract climbed 18 cents to close at US$71.49 per barrel, while the July copper contract closed up a penny at US$3.07 a pound.

In New York, the Dow Jones industrial average ended up 62.52 points at 24,768.93. The S&P 500 index closed up 11.01 points at 2,722.46 and the Nasdaq composite index ended up 46.67 points at 7,398.30.

The boost in U.S. stocks came in part from encouraging news on the retail front, with Macy's posting surprisingly strong results a day after overall U.S. retail statistics came in line with expectations.

The Canadian dollar averaged 78.07, up 0.41 of a US cent, which could have also seen a boost from increased optimism on the energy front, said Bryan.

The June gold contract ended up $1.20 at US$1,291.50 an ounce, and the June natural gas contract ended down two cents at US$2.82 per mmBTU.

Home Capital Group Inc. said it had secured a $500-million standby credit line from two unnamed Canadian banks to replace its more costly emergency funding facility from Warren Buffett's Berkshire Hathaway Inc. The company's share price ended down 13 cents or 0.92 per cent to $14 on the day.