Fixed some more bugs in send/receive.