Fix with_connection so that the host does not get overwritten.

@bfulton