Fixed asynchronous config loading potentially resulting in host and port not being applied.
Added trailing newlines and client bugfix.