The gasoline that was used has NOTHING to do with the original poster's symptoms, either the reason or the solution.
The "lean" codes do not mean the engine is running lean, it means the computer thinks the engine is running too lean even after trying to enrichened the mixture.
If your codes were P0171 and P0174, you have a classic case of an air leak somewhere in the intake system after the MAF. There are several active threads regarding this and I suggest you review them for more information. However, with the misfire code present, it might be possible you just need plugs and wires. Are you encountering any driveability concerns such as surging, hesitation, etc?
Please post the EXACT codes given, not an abbreviated description. Without the exact codes, an accurate diagnostic cannot be begun.
If your scanner can check for "pending" codes, look at those also as the 171 and 174 codes take several drive cycles to be set.
As for the "egr" code, again, the exact code number is needed.
Steve