Moved tests to proper order and ensuring shutdown of TR after each test.