Changed the logic about how automatic server selection and connection
and disconnection to location services are triggered.