Adds support for reading attachments.
Error message cleanup.