Fix intersect function.