fix count_pts_in_poly bugs