Minor improvement to be able to control test log using ENV
Improved termination sequence based on various experiments...

unfortunately the conditions are hard to create tests for.