Fix attachment re-ordering errors