Fixes line intersection checking