Misc fixes to server and client sending