Fix multiple file attachment crash

And other improvements…