My wife's 1998 Subaru Outback threw a check engine light the other day, and when I read the code, P0507, it corresponded to a problem I'd noticed for a while: high idle rpms. The problem is most serious with the A/C on; when the compressor clutch kicks in while stopped, if your foot isn't firmly on the brake, the vehicle will lurch forward as the computer increases the idle.
I did some research and on automatic-transmission models, the most common cause of this problem seems to be a broken or dirty IAC (idle air control) valve. So the first thing I tried was removing the hose from the air intake into the IAC, and spraying Seafoam into it with the engine running. In order to get the engine to run with the hose off, I had to remove the electrical connector from the MAF (manifold air flow) sensor just past the air filter; otherwise, the computer saw no airflow and cut off fuel injection, causing the engine to stall within 5 seconds. I also had to turn off the A/C to keep the engine from running extremely rough when the clutch kicked in.
After making those changes, running the Seafoam through the IAC was easy. I just gave it about 10 spurts (of the spray variant), waiting a few seconds after each one, then shut the engine off after running it another 30 seconds or so. After reconnecting everything, the idle was down to about 650-750 rpms (previously 1000+, 1200+ with the A/C on) and the vehicle seems to be running much better. I cleared the CEL code and it has not reappeared.