Investors nudged U.S. stocks into positive territory Monday, thanks in part to another round of corporate couplings.

Three proposed acquisitions — including medical device-maker Medtronic’s $42.9 billion bid for rival Covidien — helped the market eke out a slight gain for the second trading day in a row.

Homebuilding stocks also got a boost from a survey showing that U.S. homebuilders’ outlook on the housing market improved this month.

Stocks mostly hovered between small gains and losses through much of the day as traders monitored the conflict in Iraq and considered its potential impact on oil prices.

Major U.S. stock indexes were down in premarket trading, but began to rebound within the first hour as investors bid up shares in Ireland-based Covidien. The stock jumped $14.73, or more than 20 percent, to $86.75. Medtronic shed 67 cents, or 1.1 percent, to $60.03.

“Merger Monday clearly gave a lift to the market,” said Joe Peta, managing director at Novus.

Two other deals also drew heightened interest from traders. Williams Cos. hit an all-time high after the pipeline operator agreed to buy a part of natural gas processor Access Midstream Partners for nearly $6 billion. Williams vaulted $8.84, or 18.7 percent, to $56.02.

Douglas County-based TW Telecom climbed $2.65, or 7.3 percent, to $38.99 after the Internet provider agreed to be acquired by Level 3 Communications of Broomfield for about $7.3 billion, including debt. Level 3 shares fell $1.79, or 4.1 percent, to $42.30.

AirPods have become a rare public misstep for Apple. In September, Apple marketing chief Phil Schiller hailed the earbuds as the entree to a wireless future, with seamless connection to an iPhone and a five-hour battery life.

The brokerage industry’s self-regulator has asked employees fired by Wells Fargo & Co. and stripped of their securities registrations to come forward if they have concerns over their treatment, the latest sign of growing scrutiny on the bank.

Ford Motor Co. is going ahead with plans to move small-car production from the U.S. to Mexico despite President-elect Donald Trump’s recent threats to impose tariffs on companies that move work abroad.