Fix two bugs in IPv6 parsing (IPv4 section).

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23598
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23599