Fix ranges comparison.