[Server] Fix some bugs