In 1982, McCain was elected to the United States House of Representatives, where he served two terms. He entered the U. S. Senate in 1987 and easily won reelection five times. While generally adhering to conservative principles, McCain also had a reputation as a "maverick" for his willingness to break from his party on certain issues. His supportive stances on LGBT rights, gun regulations, and campaign finance reform were significantly more liberal than those of the party's base. McCain was investigated and largely exonerated in a political influence scandal of the 1980s as one of the Keating Five; he then made campaign finance reform one of his signature concerns, which eventually resulted in passage of the McCain–Feingold Act in 2002. He was also known for his work in the 1990s to restore diplomatic relations with Vietnam. McCain chaired the Senate Commerce Committee and opposed pork barrel spending. He belonged to the bipartisan "Gang of 14", which played a key role in alleviating a crisis over judicial nominations.