DURING the multitudinous demonstration against Brazil’s president, Dilma Rousseff, in São Paulo on March 15th, a lunatic fringe chanted for a return to military rule. That was sad more than worrying. The rightists were shouted down. Their isolation served to underline how routine democracy has become in many Latin American countries in the third of a century or so since the generals returned to barracks.

That outcome was not inevitable. Compared with Europe or North America, democracy in Latin America must struggle against big obstacles, including poverty, gaping income inequality and corruption. Another is poor institutional design. Latin America combines directly elected presidents, as in the United States, with multiparty legislatures chosen by proportional representation, in the manner of many European parliamentary systems. The result has often been gridlock: weak governments have lacked majorities in legislatures unthreatened by dissolution, which induces consensus in parliamentary regimes.

These problems have mattered less in the past decade or so. Faster economic growth, falling poverty and rising government spending meant that presidents were popular. Some took advantage to push through constitutional changes to allow re-election and concentrate all power in the presidency.

Those days are now over. With the end of the commodity boom, growth has slowed or stopped and so has the fall in poverty, making corruption less bearable. As well as Ms Rousseff, Mexico’s Enrique Peña Nieto and Michelle Bachelet in Chile have seen their approval ratings slump to record lows. Public cynicism towards politicians in general is widespread.

Not coincidentally, political reform has moved to the top of the regional agenda. In fact, Latin America has long fiddled with the rules of electoral and party systems. A forthcoming study of 18 countries by Flavia Friedenberg and Tomas Dosek of the University of Salamanca found 220 such reforms in 1978-2015. These tended to boost presidential power, and also tried to ensure that previously excluded groups (such as indigenous people) were better represented.

What is needed now are measures to strengthen parties and to reform their financing to reduce corruption and influence-peddling. The problem is that politicians are notoriously reluctant to change the rules under which they were elected.

The need is especially acute in Brazil, which suffers the world’s most fragmented party system, with the 513-seat lower house of Congress Balkanised among 13 “effective” parties (ie, those with more than a handful of seats). The response has been an increasingly dysfunctional “coalitional presidentialism”. Ms Rousseff heads a coalition of nine parties and an absurd cabinet of 39 ministries to accommodate them. The cost of politics has risen relentlessly, partly because of “open lists” in which each candidate competes against colleagues from the same party as well as against rivals. States act as single constituencies, so the 70 deputies for São Paulo must canvass 30m voters.

Congressional leaders favour a change under which voters would in effect choose individuals regardless of party. This would make politics even more expensive, argues Cláudio Couto, a political scientist in São Paulo. More sensible would be to create smaller constituencies and, above all, barriers to the multiplication of parties. The Supreme Court in 2006 inexplicably quashed a law introducing a German-style threshold of 5% of the vote for parties to win seats in Congress. Mr Couto thinks the best that can be hoped for is smaller steps, such as barring electoral coalitions, which would force parties to merge.

The second task, in Brazil and elsewhere, should be to enforce stricter rules on party financing. The corruption scandal embroiling Petrobras was in large part due to the voracious greed of the ruling Workers’ Party and its allies. Public opinion is hostile to state funding of parties. For that reason, Peru’s presidents have since 2007 stopped implementing a law on public funding. Daniel Zovatto of the International Institute for Democracy and Electoral Assistance, an inter-governmental body, favours bans on corporate and anonymous donations, and partial public funding in return for much tougher scrutiny of party finances and greater internal democracy.

Political reform alone won’t improve the quality of democracy in Latin America. But as governing becomes harder, politicians should do all they can to restore the prestige and effectiveness of the region’s political systems.