the idling problem might be coming from the idle air control valve. clean it and see if it fixes any thing. if not try replacing it. make sure the map sensor and throttle position sensor plugs are connected to the right connector.