LONDON Brent oil prices gained slightly on Tuesday, stabilizing near $50 a barrel on tentative signs that a persistent rise in U.S. crude production may be slowing.

The international benchmark LCOc1 gained 15 cents to $49.83 per barrel by 1409 GMT.

U.S. West Texas Intermediate (WTI) crude futures CLc1 were trading up 18 cents at $47.25 a barrel.

Brent futures have risen for nine days in a row, the longest stretch of gains since July 2009.

Both contracts traded lower earlier in the session as many traders closed positions ahead of the U.S. Independence Day holiday on July 4, while Brent also faced technical resistance as it approached $50, traders said.

Despite this, the market’s outlook has shifted somewhat.

Late May and most of June were overwhelmingly bearish as U.S. output rose and doubts grew over the ability of the Organization of the Petroleum Exporting Countries to hold back enough production to tighten the market.

But sentiment began to shift towards the end of June, when data showed a dip in U.S. oil output and a slight fall in drilling for new production. RIG-OL-USA-BHI C-OUT-T-EIA

“The fact that prices have not come under any noticeable pressure of late points to a shift in sentiment,” Commerzbank said on Tuesday.

“This may be related to the fact that most of the ‘shaky hands’ have withdrawn from the market by now,” the bank added.

Prices rose in recent days despite OPEC production hitting a 2017 high of 32.72 million barrels per day (bpd) in June, according to a Reuters survey.

The group’s efforts to rebalance the market have been undermined by rising production from Libya and Nigeria, which are exempt from an output-cutting agreement.

Libya is pumping around 1 million bpd of crude, a four-year high.

OPEC exports rose for a second month in a row in June to 25.92 million bpd, up 1.9 million bpd from the same month last year, according to Thomson Reuters Oil Research.

“We see a recovery for oil prices in H2 2017 from current levels, with OPEC production cuts, a slowdown in global supply growth and seasonally firming demand driving up prices,” BMI Research said, although it added that “large-volume supply additions will keep price growth flat year on year in 2018”.