Corrected some bugs in Server