Fix some bugs when using single server