You could also have a bad ECT sensor or bad/dirty connection to the sensor. If the engine runs ok after warm, this is one of the symptoms.
The computer reads this sensor, and if the coolant is cold, it enrichens the fuel flow for cold start, and will keep the engine running properly until...