Fixed the bugs that prevented the client from working correctly