Fixed incorrect terminate of BaseServer