Just because it ran fine on your friend's car doesn't mean the chipped ECU isn't at fault. I don't know enough about how it's programmed to know if your O2 sensor is the culprit or not, but it is a good starting point.
__________________
-Harry
AIM: NDcissive
CRX and Pre '92 Civic, Engine Tech and Tuning, & Track and Autocross Forum Mod