Minor changes to AutoSwitch and selection code

Changed the AutoSwitch code so that it didn't fire incorrectly. (For those who don't remember, AutoSwitch is the tiny thing I added so that the Ribbon automatically switched to a contextual tab when it appeared... the name sounds cooler than the actual feature ;) ). Also made small adjustments to the new code based on "SelectionChanged" so that contextual tabs don't appear at the wrong times.