Fixed minor bugs in server.