Add the client test, fix a bug.