Big fix. Tolerance number check not breaks out of loop if tolerance is
exceeded.