Was your car cold when it tested? That is the no. 1 cause of cars faili
ng emissions. Cold cars often fail....that is a general rule! If you drove it
a considerable distance to the testing place it should be OK though.
About rough idles, starts. Check o-rings, all hoses for vaccuum leaks,
and try cleaning out your intake system and the idle stabilizer valve. That ca
n help. Also, your injectors may be leaking down...how bad, I dunno?