OK, back on topic:

I think I screwed up when I rewired the cord to my 564. If you recall, I rewired it as a 565, with an individual ground for each lamp. But there's a problem.

I get DT for line 1 and line 2 (only have two lines total), but when line 2 is recieving incoming call, the lamp lights up very dimly, in unison with the lamp for line 3.

The lamp works fine for line 1

I was wondering if it had anything to do with the way I wired the A and AI connectors.

Inside my 564, the AI terminals are in a row above the line terminals segment, with a letter code facing the rear end of the phone.

The letter markings for the AI terminals are as follows from left to right looking at them with the rear of the phone facing you:

B(or 1B, can't really make it out)
EB
EH
ET
ER
then two terminals marked as SG.

The corresponding A terminals are
1H
2H
3H
4H
5H

The way I wired them is as follows:

1H-white/orange
B(or 1B)-orange/white

2H-white/slate
ER-slate-white

3H-green/red
ET-red/green

4H-blue/black
EH-black/blue

5H-brown/black
EB-black/brown

I don't know if that's where the problem lies.