improved safety of line intersection test #50