Fixed encoding of messages in the mongo collection.