Cleanup in the server selection code