Fix a bug in az_ray_hits_polygon