Check your intake manifold gasket by spraying brake clean between the area where the intake manifold meets the head. If the idle changes when you spray the brake clean in a certain area you know the gasket is bad there. I have had this problem with an altima that I worked on before. Changed the gasket and it fixed the idle issues. Just an idea from my experience that I have had.