with the Federal Employees Retirement System (a) Retirement Section 7447 of the Internal Revenue Code of 1986 is amended— (1) by striking section 8331(8) in subsection (g)(2)(C) and inserting sections 8331(8) and 8401(19) , and (2) by striking Civil Service Commission both places it appears in subsection (i)(2) and inserting Office of Personnel Management . (b) Annuities to surviving spouses and dependent children Section 7448 of the Internal Revenue Code of 1986 is amended— (1) by striking section 8332 in subsection (d) and inserting sections 8332 and 8411 , and (2) by striking section 8332 in subsection (n) and inserting sections 8332 and 8411 . 304. Limit on teaching compensation of retired judges (a) In general Section 7447 of the Internal Revenue Code of 1986 is amended by adding at the end the following new subsection: (k) Teaching compensation of retired judges For purposes of the limitation under section 501(a) of the Ethics in Government Act of 1978 (5 U.S.C. App.), any compensation for teaching approved under section 502(a)(5) of such Act shall not be treated as outside earned income when received by a judge of the United States Tax Court who has retired under subsection (b) for teaching performed during any calendar year for which such a judge has met the requirements of subsection (c), as certified by the chief judge. . (b) Effective date The amendment made by this section shall apply to any individual serving as a retired judge of the United States Tax Court on or after the date of the enactment of this Act. 305. General provisions relating to magistrate judges of the Tax Court (a) Title of special trial judge changed to magistrate judge of the Tax Court The heading of section 7443A of the Internal Revenue Code of 1986 is amended by striking “ Special trial judges ” and inserting Magistrate judges of the Tax Court . (b) Appointment, tenure, and removal Subsection (a) of section 7443A of the Internal Revenue Code of 1986 is amended to read as follows: (a) Appointment, tenure, and removal (1)