Hello Fabian and welcome to justanswer.com
We should also make sure you do not have a vacuum leak for the P0171 and P0174.. Start the engine and listen for a hissing noise while idling when the engine is cold. The PCV hose sometimes will split and the IMT valves sometimes leak. This will cause vacuum leaks. The PCV hose goes from the valve to the intake and the IMT valves are the electronic valves located on the right hand side of the intake manifold. I also see issues with the booster hose from the brake booster to the intake.
FOr the other code P1643 we should check fro water in the TCM. The TCM is located behind the driver side of the dash in the upper corner. Look under the dash and you should first see the auto wiper module if equipped. Remove the 10mm nut on that module and pull it down and out. Next you will see the TCM which is held in by two 10mm nuts. Remove the nuts then once the module is off the studs you can disconnect it. See if you see signs of corrosion in the connector or module.