Fix issue where renaming an attachment prevents saving the document.