Fix to string selection code