IT stocks and a stronger rupee contributed to gains in the Sensex and Nifty. The Nifty Midcap 150 advanced 0.05 percent, while the Nifty Smallcap 250 slipped by 1 percent on Tuesday morning.