Run ECU diagnostics first to check if anything obvious shows up including doing the 02 sensor test
http://www.ttzd.com/tech/diagnostictech.html
The second thing to do is check the connectors with the spring clip are clean and not corroded which is very common and can wreak havoc. Test the injectors when those connectors are off to ensure they are working and in spec. Lastly test the AAC valve to see if it is working and properly set the base idle.
This is a good place to start, but I'd also do a compression test, check the condition and type of spark plugs, vacuum leak test, fuel pump pressure test. The best spark plug to use are the factory Nissan NGK plugs on this engine.
As with any fuel injected engine, there's lots that can go wrong but the first 3 are the most common for your description.