Merge "Fix bugs when transitioning out of touch mode"