Fixed handling of incoming IP addresses