Fixed erroneous ipv4/6 validity checks