inserting 2019 . (2) Effective date The amendments made by this subsection shall apply to qualified second generation biofuel production after December 31, 2016. (e) Biodiesel and renewable diesel used as fuel (1) In general Section 40A is amended— (A) in subsection (f)(3)(B), by striking or D396 , and (B) in subsection (g), by striking 2016 and inserting 2018 . (2) Effective date The amendments made by this subsection shall apply to fuel sold or used after December 31, 2016. (f) Credit for biodiesel and alternative fuel mixtures (1) In general Section 6426 is amended— (A) in subsection (c)(6), by striking 2016 and inserting 2018 , (B) in subsection (d)— (i) in paragraph (1), by striking motor vehicle and inserting highway vehicle , (ii) in paragraph (2)(D), by striking liquefied , and (iii) in paragraph (5), by striking 2016 and inserting 2018 , and (C) in subsection (e), by amending paragraph (3) to read as follows: (3) Termination This subsection shall not apply to any sale or use for any period after— (A) in the case of any alternative fuel mixture sold or used by the taxpayer for the purposes described in subsection (d)(1), December 31, 2018, (B) in the case of any sale or use involving hydrogen that is not for the purposes described in subsection (d)(1), December 31, 2018, and (C) in the case of any sale or use not described in subparagraph (A) or (B), December 31, 2016. . (2) Effective date The amendments made by this subsection shall apply to fuel sold or used after December 31, 2016. (3) Special rule for certain periods Notwithstanding any other provision of law, in the case of— (A) any biodiesel mixture credit properly determined under section 6426(c) of the Internal Revenue Code of 1986 for the periods after December 31, 2016, and before the date of the enactment of this Act, and (B) any alternative fuel credit properly determined under section 6426(d) of such Code for such periods, such credit shall be allowed, and any refund or payment attributable to such credit (including any payment under section