Mitsubishi Repair Problems? Ask a Mechanic for Answers ASAP
For the P0031, I would replace the front O2 sensor, closest to the cylinder head in the exhaust manifold.
The P0171 is a lean code for Bank 1, and could be the result of a fouling O2 sensor from the heater circuit not operating.
Clear the codes after replacing the sensor.
Hopefully the code doesn't return.
I hope my advice has been of assistance to you.
Do you need any futher help?