fixed minor bugs in server protocol. More bugs expected