Toyota Repair: 1991 corolla error codes, hard starting, air fuel ratio, engine fires


Question
My '91 corolla (160k miles) has had the check engine light on for a while.  I disconnected the battery cable to turn it off for inspection.  It is back on and I got error codes 12, 25, 26; Engine RPM Signal, Air/Fuel ratio to lean, to rich.  From reading other posts I am thinking replace the distributer...  
The car went from 33 mpg to 25 mpg in conjunction with the check engine light and cooler weather.  If it is below 45 degrees it takes about 15 seconds of cranking before the cold engine fires (warm engine = no problem starting).  
The man at the part store said he thought it might be the EGR sensor (I would have expected code 71), and the other problems/error codes were caused by the long cranking.  I am looking for an expert before I drop $200 on either part.
Thank you,

Answer
It's very possible that the distributor rpm (NE) signal may be lost during cranking when cold but keep in mind that unless the computer sees this signal it will not turn the fuel injectors on, this maybe why the lean condition, after the engine fires up it sees a lean condition and wants to compensate and this may be the temporary lean/rich condition the the O2 sensors pick up, try replacing the distributor first because as you probably know from reading the other information, that they are a common cause for this problem.