Fixed possible issues with send message.