I had this problem with the D16 in my 97 Civic and was never able to fix it. Eventually when I pulled the motor later I found the wiring harness had been chewed up by a belt and I was never able to see it when the motor was in the car. Try to look at the wiring and see if you can find anything.