Remove use of gone-in-1.5 get_host function.

Also whitespace cleanup.