Fix some problems in client