Fixed bugs in client