[client] Fix a few bugs.