EMI: Rework attaching and detaching.
Merge pull request #1076 from JoseJX/FixAttachDetach

EMI: Rework attaching and detaching.