Yep, that fixed it. Thanks DT.

I'm surprised that the bug hasn't been found before now.

Out of curiosity, why did it only affect the shift on the last line, and not the first three?

Code:
T = X << 1
T = T << 1
T = T << 1
Y = T << 1 + T + X