Fixed some bugs in server and UI work in client.