Stocks turned lower by late afternoon Friday as an energy sector rally eased. 

The S&P 500 was down 0.27%, the Dow Jones Industrial Average fell 0.26%, and the Nasdaq was flat.

Crude oil pulled lower after the latest weekly read on active oil rigs fell, though at a slower-than-expected pace. Crude oil drilling rigs in the U.S. fell by 13 to 400 in the past week, according to Baker Hughes data. West Texas Intermediate crude closed 0.9% at $32.78 a barrel. 

The energy sector remained the best performer on markets Friday, though were off session highs. Major oilers such as PetroChina (PTR) - Get Report , Royal Dutch Shell (RDS.A) , Schlumberger (SLB) - Get Report , and BP (BP) - Get Report climbed, while the Energy Select Sector SPDR ETF (XLE) - Get Report added 0.4%. 

The second estimate of fourth-quarter GDP was revised up to an annual rate of 1% from 0.7%, suggesting that the U.S. economy was in better shape than expected at the end of last year. Economists had expected GDP to be revised down to 0.4% growth. A stronger U.S. dollar and an inventory buildup continued to hurt manufacturing, though, with exports down 2.7% and imports falling 0.6%. Consumer spending rose 2%, though, less than an originally estimated 2.2%.

For the Federal Reserve, "the upgrade in the Q4 GDP growth will likely offer some encouragement, though it is unlikely to change the current bias to remain on the sidelines at the March meeting as they assess the impact of the recent global headwinds on growth," said Millan Mulraine, deputy chief U.S. macro strategist at TD Securities. "We continue to see the next hike at the June FOMC meeting."

Traders had plenty of other data to digest on Friday in a jam-packed day on the economic calendar. The U.S. trade deficit in January widened to $62.23 billion, its largest level since June. U.S. exporters struggled to move goods as a stronger U.S. dollar and a weaker global economy deterred demand.

The consumer economy benefited from colder winter weather in January and lower gas prices. Consumer spending rose 0.5% in January, higher than the 0.3% growth economists had expected. Personal income also rose 0.5%.

Leaders from G20 nations gathered in Shanghai. Investors are hoping for clearer action from China, the world's second-largest economy, on how to boost growth and stabilize markets. Some hope that the two-day meeting could also result in a coordinated stimulus effort by member countries, a notion backed by the International Monetary Fund. However, some have already ruled out such joint efforts.

TheStreet Recommends

"Talking about further stimulus just distracts from the real tasks at hand," said Germany's Minister of Finance Wolfgang Schäuble on Friday. "We, therefore, do not agree on a G20 fiscal stimulus package as some argue, in case outlook risks materialize."

J.C. Penney (JCP) - Get Report jumped 13.3% after strong holiday sales and fewer promotions helped to boost quarterly profit. The retailer earned 39 cents a share over the quarter, nearly 10 times its profit a year earlier. Analysts had expected 23 cents a share in earnings. Sales rose 2.6% to $4 billion.

Gap (GPS) - Get Report fell 3.4% after narrowly beating analysts' profit estimates in its fourth quarter. Revenue fell 6.5% from a year earlier, in line with estimates, while same-store sales slid 7%. The retailer also announced that it had approved a $1 billion share buyback program.

Weight Watchers (WTW) - Get Report slid 27% after reporting an unexpected loss in its fourth quarter. The weight-loss company reported a net loss of 3 cents a share, compared to estimates for a profit of 2 cents. Revenue fell 21% to $259.2 million.

Palo Alto Networks (PANW) - Get Report added 1.9% as its quarterly loss widened to 72 cents a share from 53 cents a year earlier. On an adjusted basis, earnings totaled 40 cents a share, a penny above estimates. Revenue jumped 54%.

Sotheby's (BID) - Get Report shares fell 2.4% after the auction house swung to a quarterly loss. The company reported a fourth-quarter loss of 17 cents a share compared to profit of $1.06 a share a year earlier. Adjusted earnings of $1.19 a share came in above estimates.

Foot Locker (FL) - Get Report was down 4.2% despite a better-than-expected quarter. The retailer reported a 7.9% increase in comparable-store sales, building on top of the 8.7% growth seen in the fourth quarter. Foot Locker expects comparable-store sales to rise in the mid-single digits for the rest of the year.

Kraft Heinz (KHC) - Get Report added 3.4% after swinging to a profit of 23 cents a share in its fourth quarter, compared to a loss of 4 cents a share a year earlier. The company said it is working on streamlining its organization after completing its merger in the middle of last year.

Kraft Heinz is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio.

Exclusive Look Inside: You see Jim Cramer on TV. Now, see where he invests his money and why Kraft Heinz is a core holding of his multi-million dollar portfolio. Learn more now.