TPS? No way.
The 538 happens if you don't goose it for the "goose test". You have to blip the throttle at a certain time if you do the KOER (Key on engine running) test. You had the engine running during the test, yes?
The 172 code means your oxygen sensor on the back of the engine (right by the firewall) needs replacing. Oh the joys of changing that one!
Replace the O2 sensor and you should be golden.
-Lance