Bugs in document attachment creation