When the final results are tabulated, President Trump’s first midterm election will fall short of the “shellacking” endured by Barack Obama, closer to the “thumping” voters handed George W. Bush. But the signs for Trump’s re-election aren’t all bad.

Let’s not sugarcoat it: The Trump-era GOP has a real problem in the suburbs that is unlikely to be resolved as long as he remains titular head of the party. And the Republicans’ failure to compete in Senate races in the Rust Belt — complete with Scott Walker losing his bid for a third gubernatorial term in Wisconsin — does not bode well for Trump repeating in the states where he penetrated the Democrats’ blue wall in 2016.

Republicans still have reasons for cautious optimism, however.

It could have been worse. During Bill Clinton’s first midterm election in 1994, Democrats lost 54 seats in the House and and nine seats in the Senate. Two Democratic senators switched parties to the GOP shortly thereafter.

During Barack Obama’s first midterm election in 2010, Democrats lost 63 seats in the House and six seats in the Senate. Four years later, during Obama’s second midterm election, Democrats lost 13 seats in the House and nine in the Senate, giving Republicans control of both houses of Congress.

Republicans have lost 28 seats in the House as of this writing. That number is likely to rise into mid-30s. But Republicans gained three Senate seats and may net a fourth, subject to a recount. All this in a climate where Trump is supposed to be a world-historically bad president. If this is the worst that it gets, Trump has a shot in 2020.

Trump’s ability to turn out the base remains strong. The president practically willed Mike Braun across the finish line in Indiana’s Senate race. He was helpful to Josh Hawley in Missouri and Kevin Cramer in North Dakota. Republicans came up short in Montana and West Virginia, but shaved Democratic leads into the single digits.

You won’t often get such a favorable map. But Trump is good for Republican enthusiasm — better perhaps than the tax cut, the economy, or warnings about the blue wave. In a 2004-like re-election race, that could matter. Even in down-ballot races, Republicans are offsetting their suburban problems with high rural turnout.

Ohio and Florida still look winnable. Ohio’s Democratic gubernatorial nominee received more raw votes than John Kasich did in a landslide four years earlier and still lost. Florida’s Democratic gubernatorial nominee received over 1.15 million more votes than outgoing Gov. Rick Scott did in 2014 and still lost.

The Democrats won more than 2 million votes for governor in Ohio and over 4 million in Florida. Republicans still were able to beat them. Florida voted for felon reinfranchisesment, which will lead to an influx of new voters, and Ohio’s Democratic Sen. Sherrod Brown — a possible 2020 candidate — but all in all, good for Trump.

Democrats now have some ownership of Washington. As bad as things have often looked for Trump over the last two years, it was always premature to count him out before knowing two things: who his 2020 Democratic opponent will be and what Democrats will do with whatever amount of power the voters gave them before then.

A Democratic-controlled House will now be part of the problem. And Democrats won’t have enough power to advance solutions without Republican buy-in. This gives them the unpalatable choices of disappointing their base or annoying independents, who finally voted Democratic in large numbers for the first time since 2008.

Voters did want a check on Trump and the Republicans. But unless special counsel Robert Mueller’s Russia investigation unleashes something major, it is possible they will tire of the hearings, which seldom seem to change many minds.

The red-state revulsion at Senate Democrats’ treatment of Supreme Court nominee Brett Kavanaugh, who did not even poll particularly well with the electorate as a whole, shows that there can be consequences to Democratic overreach. Congressional Republican excesses helped Clinton and Obama win re-election.