Fix corner case of duplicate points.