Former Vice President Joe Biden in recent days has hammered Bernie Sanders for votes against gun-control initiatives – some of which the Vermont senator cast decades ago.

Sanders has responded that some of his views on guns back then were more in line with Vermonters who supported the National Rifle Association but says he has made a 180-degree shift on the issue given the ongoing series of mass shootings in this country.

During the Democratic debate in South Carolina earlier this week, Sanders conceded he made some “bad votes” in the past but now ardently supports expanding background checks and ending the gun-show loophole for firearm purchases.

“I have today a D-minus voting record from the NRA,” he told CBS debate moderator Norah O’Donnell Tuesday night.

Hitting Sanders on decades-old gun positions is a way for Biden to demonstrate to a one of his targeted key constituencies — namely, suburban swing-voting moms — that he’s been battling the NRA consistently for more than a quarter-century while bashing Sanders’ record on the issue.

The former vice president hasn’t let Sanders off the hook for those votes, blaming him for passage of a 2005 law that shields the firearms industry from wrongful-death lawsuits, an argument Hillary Clinton also made against Sanders during the Democratic Party’s 2016 nominating contest.

“That has caused carnage on our streets,” Biden argued at the debate, which was held just blocks from a historic black church where nine people were killed in a 2015 mass shooting.

Yet, on another issue that plays to Sanders’ base and also dates back to 2005, student-loan forgiveness, Biden has his own set of bad votes — positions he now eschews in his third bid for the party’s presidential nomination.

Following Sanders’ lead on student-loan forgiveness, Biden’s presidential campaign has a $750 billion plan to “fix student loans” and overhaul the country’s “broken” student-loan system. The former longtime senator also now supports borrowers’ ability to discharge private student loan debt – those taken out from commercial banks without the government’s backing —in bankruptcy proceedings.

Biden’s student-loan plan represents a radical departure from positions he held during bankruptcy-law negotiations in the early 2000s. Then a senator from Delaware, he forcefully backed measures that made it much harder for private student-loan borrowers filing for bankruptcy to shed that debt. Representing many of the big financial institutions based in his home state, Biden was such a reliable advocate for the financial services industry that he was often referred to as “the senator from MBNA,” the credit-card company that regularly doled out contributions to his campaigns.

In promoting a 2005 bankruptcy reform measure, Biden argued that too many people were skipping out of their debts too easily and sticking other borrowers with the bill while interest rates rose as a result.

It was a more widespread view at the time – although most lawmakers who held it were Republican or more centrist Democrats; bankruptcy filings were high in the late 1990s when the economy was humming along and consumer credit was easily attained. The lending industry complained that the filings were not only costly for creditors but also for consumers who experienced higher interest rates as a result.

Biden pursued this pro-banking agenda while his son Hunter, fresh out of law school, worked at MBNA for five years and was retained as a consultant for another five.

“An awful lot of people are discharging debt who shouldn’t,” Joe Biden said at a 2001 hearing. “I am so sick of this self-righteous sheen put on anybody who wants to tighten up bankruptcy is really anti-debtor.”

Some of those debtors were college students who took out commercial loans instead of traditional education loans backed by the federal government. During the same 2001 Judiciary Committee hearing, Biden argued that he and his sons took out commercial student loans for law school and they didn’t discharge the debt even though it amounted to more than $100,000. Why should other students who had fallen on hard times be allowed to do so, he asked.

“Something is wrong with a system that allows guys like me getting out of law school discharging our law school debt front-end — guys like me getting out of medical school discharging their medical school debt,” he said.

A bankruptcy court judge also testifying that day took issue with Biden’s stance, arguing that government-backed student loans aren’t dischargeable – something that has remained the case since then, as well.

“You would never be able to do that,” Judge Randall Newsome said.

“Like heck you can’t,” Biden countered. “…You are fully of malarkey, judge.”

Newsome was just one of the many opponents of the bill whom Biden sparred with at the time. Elizabeth Warren, then a Harvard law professor, opposed the bankruptcy bill so aggressively that she says it inspired her to run for the Senate.

“I got in that fight because [families] just didn’t have anyone, and Joe Biden was on the side of the credit card companies,” Warren said at an April rally in Iowa. “It’s all a matter of public record.”

Biden and others who backed the 2005 bankruptcy reform bill argue that it helped consumers by lowering interest rates. It also contained provisions aimed at protecting low-income households and, thanks to Biden’s efforts, contained language aimed at helping the interests of divorced women and their children, he has argued.

Fast-forward 15 years and Biden’s campaign website makes no mention of his support for the 2005 measure nor his past support for cutting off borrowers’ ability to discharge those loans. Instead, it calls for a “crackdown on private lenders profiteering off of students” and for allowing “individuals holding private loans to discharge them in bankruptcy.”

Biden’s campaign points out that private student loans currently account for just 10% of all student loans and say the provisions were not a heavily debated part of the 2005 bill. His campaign also says that the nature of the student loan market in the country has changed dramatically since 2005 as students began to carry heavier and heavier loan burdens, rising to a staggering $1.5 trillion in total student-loan debt in 2018, according to the Federal Reserve.

This mushrooming burden, which has hit millennial students the hardest, led the Obama-Biden administration in 2015 to back legislation that would make private student loans dischargeable. And in 2016, the administration put regulations in place allowing the secretary of education to grant relief to borrowers from predatory for-profit educational institutions.

As part of the Obama-Biden policies aimed at helping student borrowers, they backed changes to government-backed student loan repayments that would limit monthly payments to 10% of monthly discretionary income.

Biden now wants to go even further. If elected president, he promises to press Congress to pass a law permitting borrowers to discharge private student loans. He also pledges to “empower the Consumer Financial Protection Bureau – established during the Obama-Biden administration — to take action against private lenders who are misleading students about their options and do not provide an affordable payment plan when individuals are experiencing acute periods of financial hardship,” according his campaign website.

Meanwhile, Warren, who originally proposed the creation of the CFPB and headed the agency in its first year, and Sanders are calling for full student-loan forgiveness and want to make public colleges tuition-free.

The Consumer Federation of America opposed the 2005 bankruptcy reform bill, as well as earlier iterations of it, deeming it “too harsh on debtors.” The group’s lobbyists at the time cited Biden as the “linchpin” in getting it passed.

Chris Peterson, CFA’s director of financial services, declined to comment about Biden’s 2005 role, citing the organization’s status as a non-partisan entity that is not taking sides in the presidential contest. Still, he cited the bankruptcy reform law as contributing to the current student-loan problem. All student loan debt is particularly difficult to discharge, he said, and sometimes follows debtors their entire lives, causing new financial problems for some in retirement.

“It’s very hard to shed student-loan debt — it tends to follow you for life and it can interfere with people’s ability to get Social Security benefits,” he told RealClearPolitics. “If you can’t discharge it, the debt doesn’t go away and continues as you face other financial challenges in life like divorce or a failed business venture.”

“We don’t usually think of student loans as being a problem for older Americans on the verge of retirement, but increasingly it is,” Peterson said. “There are hundreds of thousands of people 50 years or older who have unpaid student debt and paying it off is now becoming a part of their retirement planning.”

Numerous studies have documented how soaring student-loan debts have disproportionately impacted minority students, with African Americans more likely to take on debt for school. Black borrowers also are nearly five times as likely to default on loans as their white peers, according to a report by the Brookings Institution.

Dalie Jimenez, a law professor at University of California-Irvine, says statistics don’t exist on the number of minorities who take out private student loans (commercial banks aren’t required to report the demographics of their borrowers), so it’s difficult to discern whether these borrowers suffer similar debt problems in that regard as they do under the government-backed program. Still, because private loans charge higher interest rates and offer fewer protections than traditional federal education loans, minority students who use them would likely face higher hurdles in paying them off, she told RCP.

Jimenez also declined to weigh in on the different Democratic candidates’ student-loan forgiveness plans or Biden’s role in making private student-loan debt much more difficult to discharge. But she noted that since passage of the 2005 bill, private loans have required more co-borrowers, with 90% now mandating a co-signer in order to be approved. Jimenez cited a 2012 Consumer Financial Protection Bureau report to the Senate, the latest data on private student loans available.

The co-borrower requirement makes the loans even harder to discharge. “If a student dies, then parents and spouse are still on the hook for the loan,” she said.