Fixed handling of IP address