Fix TermTransformer not keeping attachments in all cases.