Replace == 0 with <= EPSILON in the bilevel program.