Fix remaining bugs in message passing