OK, I've been driving the car to make sure it doesn't have any other issues before I sell it.
When I first got the car, one of the faults was, "17746 - Camshaft Position Sensor (G40) P1338 - 001 - Open or Short to Plus - Intermittent". I just assumed it was one of the many faults due to the dead battery.
After installing the new engine, I cleared the code, and it didn't return. A couple weeks later I did a scan and noticed it had returned ... hmmm ... this is a completely different engine, and completely different Cam Position Sensor. I replaced the Camshaft Position Sensor with the one off the old engine and cleared the codes again.
In the last few days I noticed it had returned again, but now, with the engine running, if I cleared the code, it came right back. I figured it had to be a wiring harness issue. What's strange though ... the engine ran fine!?
The other issue that I discovered is, the fuel pump doesn't run when the divers door is opened ... hence, the engine takes longer to start than normal after it's been sitting for a while. The interior light doesn't come on either when the driver's door is opened ... although the light DOES come on when any of the other three doors are opened. Obviously, I'll have to look at the driver's door latch. I mention this because I've heard longer cranking times can set a Cam Position Sensor code sometimes.
I checked the three CPS terminals ... all where fine except term. 1 ... no continuity between the CPS connector, and the plug terminal 98.
So, after checking Bentley's wiring diagrams, I soldered a wire from Term. 1 on the CPS connector ... and made a three-way solder connection on term. 3 of the MAP Sensor connector (which is also connected to Term. 98 - I had no codes for the MAP Sensor).
After reassembling everything ... the car runs fine with no more codes ... and I drove it for quite a while.
What I DON'T understand though is ... the engine ran fine BEFORE I fixed it! How could the engine even run WITHOUT a Cam Position Sensor?