Fixing the tests by adding a configurable termination method