Fixed message sending code.