Added detection of network reachability.