Fixing some minor bugs in the server.