Fix attachment handling