Avoiding quit hanging + better verbose logging
Merge pull request #2168 from sebv/test-session

Test suite improvement.