Fixed some bugs on the client.