Add tests for teardown fixes