Disconnect the battery for 10-15 minutes, it lets ECU reset. What I am guessing is when you ran the truck w/out MAF input your computer tried to compensate and that is why you got the Check Engine Light. When you reconnected the MAF again, your computer again tried to compensate. Your computer needs to be reset. Don't over look the obvious though, any vacuum leak in the intake can cause those codes, double check you connections for your CAI. Under filled, over filled, bad tranny fluid can lead to hard shifts. Hope this helps.
(SOLD) 2003 Ranger 4.0L V6 FX4
2001 F150 Supercrew Triton V8 (DD)
2008 Fusion 3.0L SEL V6 (my baby)
1992 Taurus SHO MTX (my toy-almost Supercharged)
2004 Nissan Murano SL AWD (Wife's car)