Fixed some issues with the intersection point function