Bad things do sometimes happen in Philadelphia elections. Usually the people responsible are caught and prosecuted, if a crime occurred. Other incidents become the stuff of legend. As in all mythology, legends often don’t stand up well to scrutiny.

President Donald Trump misled a national television audience Tuesday with his most recent conspiracy theorizing, wrapping up his first debate with Democratic nominee Joe Biden with a false claim that poll watchers were improperly barred from polling places in Philadelphia earlier that day.

“Bad things happen in Philadelphia,” Trump said. In reality, his campaign currently has no poll watchers certified as required by state law. And there are no actual polling places open, just new satellite election offices for requesting and submitting mail ballots.

“There are irregularities in any election, and that’s why we have law enforcement, that’s why we have the Department of Justice, that’s why we have the District Attorney’s Office,” Philadelphia Mayor Jim Kenney said in an interview Wednesday. “Philadelphia is in the modern era. Your system of voting in all of the neighborhoods in the city are dependable and fair and honest.”

Trump has a long history of falsehoods, exaggerations, and unsubstantiated allegations that help to fire up his supporters in Pennsylvania and elsewhere, but have little to do with facts.

Let’s examine some of those facts.

The city’s most infamous election fraud case came during a 1993 special election for a state Senate seat in Northeast Philadelphia. Bogus absentee ballots were filled out to benefit the Democratic nominee, William Stinson, who received 79% of the overall vote. A very public investigation, including reports from The Inquirer, followed. A federal judge threw out the ballots, ruling that election officials had illegally distributed many of them to campaign and Democratic Party workers. Stinson was removed from office as a result.

Philadelphia’s most viral moment of election controversy didn’t involve fraud. It came in the 2008 presidential election, when two members of the New Black Panther Party, one holding a nightstick, stationed themselves outside a North Philadelphia polling place. One Republican poll watcher called in a complaint while another shot video that received plenty of play on Fox News, thanks to efforts by Mike Roman, a former Republican ward leader from Northeast Philadelphia who is now a Trump campaign official. Roman on Tuesday tweeted the false claim about poll watchers Tuesday that Trump seized on.

No actual voters complained in 2008 about the New Black Panther Party members, who left when police showed up. Still, Trump his campaign team spoke often about the incident in 2016.

Another canard pushed by Trump in 2016 was the notion that Mitt Romney, the 2012 Republican nominee for president, had been cheated in Philadelphia because he received no votes in 50 city voting divisions. Fifty sounds like a lot, absent the context that city had 1,687 divisions that year. So Romney received no votes in just 3% of the divisions. Inquirer reporters canvassed those divisions after the 2012 election and found no Republicans complaining about uncounted votes. Joe DeFelice, now a Trump administration official, was chairman of the city’s Republican Party in 2016. He and the Republican ward leaders for those divisions helped debunk Trump’s claim.

Some claims debunk themselves. During the 2016 election, conservative political provocateur James O’Keefe posted a short video of him in a car trailing a van that O’Keefe described as a “pastor bus, bussing people around to the polls in Philadelphia."

“We’re going to be releasing video here today showing people doing some improper things, bussing people around," O’Keefe said in the clip, which was a teaser for a longer video on voter fraud. But what O’Keefe alleged the pastors were doing — transporting voters to the polls — is legal. And the full video O’Keefe ended up releasing on voter fraud was actually filmed in Indiana, not Philadelphia.

Philadelphia had an actual case of election fraud in 2017, during a special election for a state House seat in North Philadelphia. Pennsylvania Attorney General Josh Shapiro, a Democrat, charged polling place workers in one location with intimidating voters, casting bogus ballots, and falsely certifying results. The investigation stemmed from complaints filed with the Philadelphia District Attorney’s Office. The Democratic nominee won that race with 73.5% of the vote, so the illegal acts were unlikely to have had much impact on the results.

Another case of election fraud went public this year when a South Philadelphia judge of elections pleaded guilty to federal charges for taking bribes to inflate votes for Democratic candidates. Dominic DeMuro was a Democrat until just before his guilty plea. Trump’s campaign and the Republican National Committee used the case to again claim voter fraud is a widespread problem. The U.S. Attorney’s Office in Philadelphia has charged another Democrat, former U.S. Rep. Michael “Ozzie” Myers, with bribing DeMuro. Myers served three years in prison after he was convicted in the 1970s Abscam investigation into public corruption.

Kenney said the fact that Myers and DeMuro were prosecuted proves that elections in Philadelphia are generally secure, and not the other way around.

“There are so many mechanisms to deal with [fraud], and I point to the fact that Mr. Myers and Mr. DeMuro were caught," he said.

Election experts say it’s no coincidence that Republicans frequently target large, diverse cities like Philadelphia for voter fraud allegations. In her book The Politics of Voter Fraud, Lorraine C. Minnite, a political scientist at the University of Rutgers-Camden, wrote that “the use of baseless voter fraud allegations for partisan advantage has become the exclusive domain of Republican party activists.”

“Fraud allegations today typically point the finger at those belonging to the same categories of voters accused of fraud in the past – the marginalized and formerly disenfranchised, urban dwellers, immigrants, blacks, and lower status voters,” Minnite wrote.

Trump in 2016 also complained often about the overturning of Pennsylvania’s “Voter ID” law, which was passed in 2012 but shot down by the courts two years later after its Republican proponents couldn’t produce evidence of the widespread voter fraud they claimed necessitated people showing state-approved ID to cast a ballot. A state judge ruled they had offered only “a vague concern about voter fraud.”

That’s a common refrain to rebut oft repeated but seldom substantiated voter fraud theories. Shapiro, who has challenged the Trump campaign this year in court to provide proof of voter fraud in Pennsylvania, has been telling the president to “put up or shut up” in television interviews.

Conservative groups that drive voter fraud narratives have also repeatedly claimed, without evidence, that people illegally vote in the name of people who have passed away in Philadelphia. That’s because the Pennsylvania Election Code sets a standard for how voters who have died or moved away can be purged from the rolls.

Voters are labeled “inactive” if they haven’t cast a ballot for five years and then also don’t respond to a notice mailed by election officials. They can be removed from the rolls after that only if they don’t vote in the next two general elections in which federal offices are on the ballot. So it can take seven to eight years to purge a dead voter.