Hi, I am having a problem with my 2002 Discovery. When I turn the ignition it cranks but immediately stalls. If I turn the ignition and rev the engine it will not stalls most of the time. Sometimes it will still stall but after a couple of times and as long as I keep the gas pressed it stays on. Then once the temp of the Discovery gets to about mid point I can start driving the car normally. But up until getting to that temp if I try to drive it it will stall as soon as the gas isn't pressed. I have changed the IAC and checked for vacuum leaks. Thinking it may be a crank shaft sensor but any thoughts. The check engine light is on and the codes are P0171 and P0174. Any help is appreciated.