Fix attachments

Multiple attachments were broken.. Apparently adding an attachments
messes with the header lookup loop.