correct few bugs in client lib