Fix two bugs in server.c