Improved getIpAddress method in GeoIpService.