fixed a crash at getting intersections
fixed logic in detecting invalid quadratic