Fixed sending and receiving messages.