Fix no solution case. Use break instead of failure condition.