Ford Ranger OBDII codes P0171 and P0174

The system described by Cigroller (the Evaporative Emissions System) is not causing the codes you posted. As Cigroller said, they have their own special fault codes. And a leak in that system cannot cause a lean bank.

However if you’re smelling gas and had “spillage from underneath” you should get this looked at ASAP. Gas fumes are not safe.