Improved termination criterion