Fixes to server teardown.