Use separate args for stringification and memoized calls.

Fixes #1874
Correctly handle *. in the host part of match patterns.

Fixes #1899.