NEW YORKSeveral publicly traded energy companies took millions of dollars in U.S. taxpayer-funded loans to support their businesses even as those firms had access to other ways to generate cash, according to a Reuters analysis of U.S. Securities and Exchange Commission and other government data.

U.S. lawmakers authorized the Paycheck Protection Program (PPP) in the spring to help businesses cope with loss of revenues as the coronavirus pandemic worsened. While numerous small businesses benefited, larger publicly traded companies also took loans, though many also restructured finances or drew on credit lines.

Overall, at least a dozen publicly traded energy companies received about $50 million combined in PPP loans as they also restructured credit lines, cashed in crude oil hedges or tapped U.S. credit markets, according to the Reuters analysis.

When Lonestar Resources US Inc. took a $2.2 million U.S. taxpayer-funded loan in May, the small shale driller still had a pipeline to Wall Street and the bond market.

Companies like Lonestar were struggling even before the worst of the pandemic, so any aid was a welcome relief. Still, it ended up agreeing to restructure $500 million in debt that piled up before the virus ravaged the economy.

“The PPP loan prevented me from having to furlough employees,” Lonestar CEO Frank Bracken said in a telephone interview prior to declaring bankruptcy. Bracken commented a day after Lonestar’s Sept. 15 announcement that it would eliminate about $390 million in debt obligations and preferred equity interests through a pre-packaged Chapter 11 bankruptcy plan.

The U.S. Small Business Administration said PPP borrowers could get loans if tapping other sources of liquidity would be significantly detrimental to their operations.

Tim Stretton, a policy analyst at Project On Government Oversight (POGO), an independent watchdog, said Lonestar’s loan would have been better suited for companies without access to debt markets.

“These mom-and-pops don’t have lobbyists in Washington or Wall Street to make sure they get the loan,” Stretton said.

Citigroup, which provided the PPP loan to Lonestar, declined to comment on its relationship with the shale driller. The bank said the bank has funded more than $3 billion through the PPP, targeting small businesses with more than 300,000 employees.

Numerous companies took loans and later returned them, including Calumet Specialty Products Partners LP, which makes lubricants and waxes. It repaid $31 million in PPP loans in full after re-evaluating its decision to take the money.

Other energy companies have taken bailout money as they worked to raise cash. Oil exploration company Amplify Energy Corp. received a $5.5 million PPP loan even as the company said in May it sold some of its crude oil hedges and used other measures to boost liquidity by $80 million. Contango Oil & Gas got a $3.4 million PPP loan from JPMorgan in April, but restructured a credit line that also boosted liquidity.

Contango and Amplify did not return messages seeking comment. JPMorgan declined to comment.