The Dow Jones Industrial Average snapped a seven-day losing streak. But only by a hair.

Stocks struggled to hold onto minor gains for much of Wednesday, even as a rally brought oil back from nearly four-month lows and energized oil names. 

The S&P 500 was up 0.31%, the Dow gained 0.22% and the Nasdaq added 0.43%. Before Wednesday, the Dow had endured seven days of losses, while the S&P 500 had fallen for two.

West Texas Intermediate crude climbed 4.05% to $41.11 a barrel, shaking off earlier data that showed an increase in domestic inventories over the past week. Crude hit its lowest level since April on Tuesday on continued fears over a domestic supply glut, weaker demand and ballooning output overseas.

The energy sector was the best performer on markets Wednesday, though gains were not seen across the board. PetroChina (PTR - Get Report) , Petrobras (PBR - Get Report) , and Kinder Morgan (KMI - Get Report) were higher, while Exxon Mobil (XOM - Get Report) , Royal Dutch Shell (RDS.A - Get Report) , and Total (TOT - Get Report) remained slightly lower.

Traders appeared hesitant to make big moves ahead of the official jobs number from the Labor Department out on Friday. The release, the most closely-watch economic data each month, could make or break the case for a Federal Reserve rate hike sooner than later. Economists expect the pace of jobs growth in July to slow after a blockbuster gain in jobs added to the U.S. economy in June. TD Securities analysts expect 188,000 jobs to have been added, while the unemployment rate will likely hold at 4.9%. The U.S. economy added 287,000 jobs in June.

The private sector added 179,000 jobs in July, according to the ADP Employment Report. Economists expected 165,000 jobs to have been added last month after 176,000 were added in June.

The services sector continued to expand at a solid pace in July, according to the latest ISM Non-Manufacturing Index. The measure fell to 55.5 last month from 56.5 in June, though remained above the 50-level, indicative of expansion. New orders increased to a robust 60.3. A separate reading on the services sector from Markit out Wednesday also showed robust growth.

The Fed leveled a $36.3 million civil penalty against Goldman Sachs (GS - Get Report) on Wednesday morning for the unauthorized use of confidential information. The charges centered on former associate Rohit Bansal who previously admitted to obtaining documents by illegal means. Bansal plead guilty to a misdemeanor charge in March.

In earnings news, Time Warner (TWX) rose nearly 3% after surpassing quarterly profit estimates. The media company earned an adjusted $1.29 a share over its second quarter, above estimates of $1.16 a share. Sales of $6.95 billion came in short of estimates of $7.06 billion. Time Warner also disclosed it has invested in a 10% stake in streaming service Hulu.

Etsy (ETSY - Get Report) reported a quarter of sales and user growth, even as a net loss came in wider than expected. The online crafts site said revenue rose 39% to $85.3 million, adding to first-quarter growth of 40%. Consensus was for $81 million in revenue. Etsy reported a net loss of 6 cents a share compared with an expected net loss of 1 cent a share. The stock added almost 9%.

Fitbit (FIT - Get Report) edged past earnings and sales estimates in its second quarter. The fitness tracker developer earned an adjusted 12 cents a share, a penny above forecasts. Revenue surged 47% to $587 million. The company also guided for third-quarter sales between $490 million and $510 million, in line with consensus of $497 million. Fitbit said it sold 5.7 million fitness bands and other devices in the second quarter. The stock rose nearly 13%. 

AIG (AIG - Get Report) increased 7% after upping its buyback plans amid pressure to break itself up. The insurance company said it plans to buy back $3 billion in shares, adding to the $3.2 billion already returned to shareholders over its second quarter. Earlier this year, AIG appointed hedge fund manager John Paulson and a Carl Icahn-picked member to its board after breakup pressure.