Fix edge cases for lineIntersects