Problem solved!
I solved the problem. P1167 and P1166 codes relate to the primary O2 sensor heater malfunction.
I tried two different O2 sensors, a "universal" sensor from Autozone and a supposedly OEM sensor from O'Reilly's. Both of them caused the car to throw a P1167 code and run rough. I finally purchased a O2 sensor from Honda, and it fixed the problem. It turns out that none of the aftermarket probes from Bosch or Denso will work on a ULEV (F23A4) 4 cyl. engine. Honda had different part number probes for the normal VTEC 4 cyl. and the ULEV Vtec engine and the probes look different and have different length cables. The computers at O'Reilly's, Autozone, or NAPA made no distinction between these two engine types.