; and (D) in the third sentence, by inserting , and rulings on all post-judgment motions after sentencing, ; (2) in subsection (c), by striking , with the approval of a judge of the district court, ; and (3) by inserting after subsection (i) the following: (j) A magistrate judge who exercises trial jurisdiction under this section, in either a petty offense case or a misdemeanor case in which the defendant has consented to a magistrate judge, may also rule on all post-judgment motions in that case, including but not limited to petitions for writs of habeas corpus, writs of coram nobis, motions to vacate a sentence under section 2255 of title 28, and motions related to mental competency under chapter 313 of this title. .