Dirty IAC/MAf will cause skewed shifts.
Sounds like you got a vacuum leak to me if you tripped a a P0171.
Especially if you just did the LIM gaskets, did you replace all the rubber "T" fittings?
Check the MAP sensor on the back of the blower...there should be a port where a "L" rubber fitting goes into the bottom of the MAP that lots of people tend to miss.