[client] Fix bugs in merge.