Fixes for #5. Ensured that transports are shutdown in more tests.