Fix a race condition, add remaining tunnel tests.