South Africa’s current account deficit narrowed slightly to 2.3 percent of GDP in the third quarter and foreign direct investment in Africa’s most industrialised economy grew, as did the trade surplus, the central bank said on Thursday.

After contracting in the last quarter of 2016 and the first of this year, South Africa’s economy has recovered, led by a large expansion in agricultural activity as the effects of the severest regional drought in decades eased with the return of more regular rainfall.

The current account deficit narrowed as an increase in agricultural exports was offset by declines in sales of mining and manufactured goods.

The economy grew two percent in the third quarter after a 2.8 percent advance in the second, raising hopes the better than expected growth may see the country avoid further downgrades into subinvestment.

The central bank however still fears the political and policy uncertainty that led to a credit downgrade of Pretoria’s local currency debt to subinvestment by S&P Global Ratings in November will continue to weigh on business and consumer confidence, and therefore growth.

At its November policy meeting the bank kept rates lending unchanged and hinted an easing cycle that began in July aimed at boosting the economy may be over.

The bank cited the increased risks of inflation posed by currency weakness, credit downgrades and political jostling ahead of the African National Congress’s leadership conference starting this weekend.

The trade surplus continued to grow, rising to 71 billion rand ($5.25 billion) from a revised 64 billion rand in the prior quarter, the Reserve Bank said in its quarterly bulletin.

Foreign direct investment recorded an inflow of 19.2 billion rand in the quarter from an inflow of nearly four billion rand previously. Portfolio flows also climbed, with the amount of non-residents buying shares and bonds worth 88.4 billion rand from 74.7 billion rand.

($1 = 13.5137 rand)

Reporting by Mfuneko Toyana; editing by John Stonestreet, William Maclean