The 05s are a real pain to relearn idle (after disconnecting battery it forgets the learned idle point). Some times letting it idle for a few minutes, without touching the throttle, works, sometimes you have to let it idle until it cycles the fans a couple times. Which means its going thru the entire warm up, fans come on, go off, idle some more, fans come on, go off, idle some more. Takes like a half hour or more.
2005 Foresters with manual trans take FOREVER to relearn idle.