The EJ25 is notorious for failing headgaskets, and my '99 Forester was no exception, though it did go 143k until they went. Subaru made improvements over the years that cut down the failure rate but were never able to totally fix it. It's an intrinsic flaw in the engine that's a result of too large a bore for the block combined with an open deck. The 2.2L closed-deck version of the same engine is bulletproof. Pre-2003 are the worst (and especially pre-1999, where failure is practically guaranteed)
The only real fix for this issue is the new FB engine with its smaller bore and redesigned heads.
The only real fix for this issue is the new FB engine with its smaller bore and redesigned heads.