Fix modify attachments path comparison (use substring comparison instead of regexp replace).