Fixed numerours errors.

Propagation of wrong values.
Reset problem after each iteration.