Add debugging information to _save_attachments