Bugs in stop criteria fixed
Merge "Bugs in stop criteria fixed"