Go back to the way it was. The candidate is selected at the convention. Delegates can vote as they please.
Originally, Presidential Electors were selected by State Legislatures. This became corrupted by gerrymandering legislative districts, among other things. In terms of primaries, perhaps States should adopt an "instant runoff" system where voters' second and third choices are counted if their first choice does not receive enough votes. This would encourage people to vote for candidates rather than against candidates and lessen the halo effect conferred on candidates who are leading in the polls.