Fix possible incorrect parsing of ipv4 addresses