Minor optimizations to line intersection