Fixed ip address canonicalization with tests.