I was getting EGR codes and O2 sensor codes on and off for a couple of years. Replaced EGR and O2 sensors to no effect - codes would show up until I replaced K&N filter (one that needs to be oiled) with basic one and cleaned MAF sensor. Cleaning MAF sensor takes $5 and 5 min.