In a midnight vote to avert another looming government shutdown, Congress overwhelmingly approved a $1.3 trillion spending bill that, for once, didn’t shortchange cities.

President Trump threatened to veto the bill the next morning, but ultimately signed it.

While the dollars appropriated to housing, community development, and other urban priorities still fall far short of what’s needed, in many cases the bill increased funding to key programs. The bill also included a key change to the low-income housing tax credit program, making it easier to finance units that are affordable for households at lower income levels than typical under the current program.

The Community Development Block Grant program, whose impact is often hidden due to the wide variety of uses for which they are eligible, was funded at $3.3 billion, up from $3 billion in 2017. That’s good news for cities like Oakland, where residents for the first time used participatory budgeting tools to help prioritize some of their city’s share of community development block grants; or like Boston, where the city used some of its community block grant funding to create a small business loan fund targeting entrepreneurs of color.

Funding for Section 4 Capacity Building Grants remained stable, at $35 million. While a tiny pot of money, it often funds community organizing and community planning work that allows people like the residents of New York City’s beachfront Ocean Bay public housing development to participate in post-disaster revitalization planning. Those discussions can go on to influence larger pools of public or investor dollars, including investors from around the world.

Tenant-based rental assistance, also known as the Section 8 Housing Choice Voucher program, was funded at $22.01 billion, an increase of $1.72 billion from last year. Starting this year, that program also has new rules that allow for higher voucher payments to landlords in more affluent neighborhoods, helping more voucher holders who want to take advantage of the “zip code effect” and move to a neighborhood where they believe they’ll find better opportunities for themselves and their children. Funding for project-based rental assistance and public housing also increased.

Of course, it’s still true that rental assistance only reaches one in five households who are eligible for it, and discrimination against voucher-holders is still rampant, even in places where such discrimination is outlawed. Meanwhile public housing’s maintenance backlog, estimated at $26 billion as of 2010, has increased an estimated $3.4 billion each year since.

The U.S. Treasury’s Community Development Financial Institutions Fund, which President Trump proposed to zero out, instead got $250 million in funding, up from $248 million last year. That’s good news to groups like Puerto Rico’s credit unions, who had been anticipating accessing those funds to help rebuild the island’s economy through solar power installed by local contractors.

As for the low-income housing tax credit program, the bill also increased the annual total amount of each state’s allocation of tax credits by 12.5 percent for the years 2018-2021, in some places helping to address increasing land and construction costs, in some places helping reduce the number of viable projects that get left on the table because there is only a limited amount of tax credits each year.

But, perhaps more notably, the bill added a provision that allows more flexibility in the low-income housing tax credit program. Previously, the program required every unit it subsidized to have an income ceiling of 60 percent area median income for tenants. In a world of rising land and construction costs in cities, in order for projects to be financially feasible, affordable housing developers have often had little choice but to set rents for all subsidized units to be affordable for households at 60 percent area median income, leaving many low-income households out of the picture.

Under the new “income averaging” rule, a building may combine units with rents set for 20 percent area median income all the way up to 80 percent area median income, as long as the average income across all subsidized units in the building comes out to 60 percent area median income. In other words, the program can now mix and match units so that a building can be financially feasible while providing more deeply affordable units than they have under the previous rules. It’s a welcome change for cities like New York, where the Department of Housing Preservation and Development has been asking for that reform for years.