Fixed errors

Fixed segfault in server, fixed <shutdown/> in client to close, fixed
<shutdown/> in server to recognize cmd