Fixes for the hostname weirdness, also the client being returned null.