Ignore the knock sensor code for now, it won't cause running problems. Diag. the o2 sensor code.
If you are watching the timing on the scanner, what you are seeing may be normal esp. if it is running bad. The PCM moves timing around after looking at inputs from all the sensors.