Fix double sending of chat messages
Fix merge mistake when rebasing for PR #1169