Fixed: Deflate while changing state only if linking or unlinking.
Don't set or remove attributes if nothing to be changed.