Made selection/deselection more efficient.