Fix indexing error that was rendering attachments unusable

Also, check for empty body-doc