That code P0161 refers to a HO2S-12 (Bank 2 Sensor 2) Heater Circuit Malfunction.
Possible causes are:HO2S heater control circuit is open or shorted to ground HO2S heater control circuit is shorted to power HO2S heater power circuit is open (check power from the relay) HO2S heater is damaged or has failed Give me a moment and I'll upload the wiring diagram for that O2 sensor so you can check the wiring for a short/open.
I am assuming this is the 3.5l.
For that wiring diagram, click here, here, here and here.
I would check that the wiring to the O2 sensor is hooked up and not burnt up or shorted by testing it. Bank 1 is the same as spark plug #1 so bank 2 is the opposite and if this is the 3.5l, that would be #2 and that is toward the front of the vehicle and the second sensor back is sensor 2.
The O2 sensors are on the 3rd page.