Stocks held gains on Wednesday morning as crude fluctuated after an unexpected increase in domestic inventories. 

The S&P 500 was up 0.25%, the Dow Jones Industrial Average added 0.15%, and the Nasdaq gained 0.67%.

Crude oil was trading erratically after the Energy Information Administration reported 1.3 million barrels of crude were added to inventories in the past week. The American Petroleum Institute had reported a decline of 1.1 million barrels a day earlier. 

West Texas Intermediate crude oil briefly turned negative before reclaiming gains of 0.5%. WTI crude was trading around $48.60 a barrel on Wednesday.

Investors awaited further clues from the Federal Reserve as to the next rate hike. The minutes from the Fed's April 26-27 meeting, to be released Wednesday afternoon, will be scrutinized for clues as to when the central bank could next hike rates. The Fed's monetary policy committee opted to keep benchmark rates at 0.25% to 0.5% at the April meeting and maintained its views on the economy.

Analysts cautioned that investors not get too optimistic over what the minutes will reveal, though.

"I don't know how much we're going to discern from that release of the minutes," Tom Siomades, head of Hartford Funds Investment Consulting Group, told TheStreet. First-quarter estimates for "GDP and [April's] weaker jobs and increased wages came out after [the meeting]."

Stocks sold off on Tuesday after two Fed members suggested the June meeting was a live possibility for a rate hike. Investors had discounted the likelihood of an increase that soon after a rough start to the year for the economy and Wall Street. U.S. GDP rose at its slowest pace in two years in the first quarter as turbulent global markets and worries over a domestic recession kept consumers from spending.

Traders are now pricing in a 19% chance of a rate hike at the Fed's meeting on June 14-15, according to CME Group futures trading. Chances remain low, though they have climbed since the beginning of the month. A July rate hike has a 36% chance.

Goldman Sachs grew bearish on stocks, downgrading equities to "neutral" over a 12-month time-frame on growth and valuation concerns. Analysts said they will remain cautious "until we see sustained signals of growth recovery." The firm also upgraded commodities to "neutral" on a three-month basis saying there was less downside potential to oil prices.

Lowe's (LOW) - Get Report added 2.6% after topping quarterly earnings estimates and reporting an impressive jump in same-store sales. Sales at stores open at least a year grew 7.3%. Like rival Home Depot (HD) - Get Report , the DIY retailer has benefited from a robust housing market and customer appetite for home-improvement projects even as overall retail trends suffered at the start of the year.

Staples (SPLS) reported a decline in quarterly profit, though lowered expectations made for a better-than-expected first quarter. Net income fell 30% to $41 million as a $66 million pretax charge tied to its intended takeover of Office Depot (ODP) - Get Report ate into the bottom line. The takeover fell apart earlier this month after regulators blocked the deal on antitrust concerns.

Target (TGT) - Get Report tumbled 8% to $67.39 after posting a challenging first quarter and issuing disappointing guidance for its current quarter. The retailer reported a 5.4% decline in sales, which CEO Brian Cornell blamed on "an increasingly volatile consumer environment." Second-quarter earnings guidance of $1 to $1.20 a share fell short of estimates of $1.36 a share.

"The stock's historically high relative discount to the S&P 500 now appears justified, and we fear management is struggling to simultaneously define its vision and manage shareholder expectations," said Jim Cramer and Jack Mohr, co-portfolio managers for Action Alerts PLUS Charitable Trust Portfolio, which owns Target shares. "We expect shares ... to ultimately trade into the low $60s."

Tesla (TSLA) - Get Report was upgraded to buy from neutral at Goldman Sachs. The firm said the change was a valuation call based on a $250 price target. Analysts also upgraded Children's Place (PLCE) - Get Report to buy, noting that management continues to turn the business around. The stock rose 2.6%.

Hormel Foods (HRL) - Get Report reported a better-than-expected quarter due to improvements in profit margins in its pork segment. The owner of spam reported adjusted profit of 40 cents a share, a penny above estimates, while also raising its full-year earnings forecast.