In addition to trial, appeal, and collateral review, there are several procedures that can modify a conviction or sentence, or reduce or eliminate collateral consequences. The governor, or in the case of a federal conviction the president, can use executive clemency to undo a conviction or reduce a sentence. Most misdemeanors and C felonies can be expunged from your record after three years (for one conviction) or ten years (for more than one conviction.) Firearm restrictions and sex-offender reporting requirements can sometimes be lifted after a statutory period. Errors in the judgment or sentence can be corrected pursuant to ORS 138.083, which I have used to have convictions undone and sentences shortened. In rare cases federal convictions can be attacked with a petition for a writ of coram nobis. And, in extreme cases, courts can use writs of mandamus to issue commands to police officers, lower courts, and government officials.