Fix attachments uploading. Implement text replacement.