Ford Ranger OBDII codes P0171 and P0174

Check for vacuum leaks.
Look for cracked hoses and spray starter fluid (ether) around the intake manifold.
Check the tubing between the MAF sensor and the manifold.
Clean the MAF sensor.
http://www.obd-codes.com/p0171