Fixed sending and processing messages.