The IDL code is probably set by the TPS being out of rig. You can set it as per this page in the TSRM.
MK3 TSRM On-Line
The Knock sensor is a coax wire that could be shorted or open somewhere, You can read that from the ECU to verify the wire if it is shorted and from the ECU to the plug end to verify the wire has continuity from the ECU. I don't know how to physically check the sensor to see if its good so basically all you can do is to check the wire. That area gets alot of heat so there is a chance that it has become brittle over time and just removing the plug could have inadvertantly broken the signal wire. There is a "How to" rewire the knock sensor here and more info on the sensor itself. The turbo has 2 btw so ignore that part of the writeup, the NA's just have one.
Knock Sensor Rewire