Added better support for TestSession