Fix issues with removing attributes in IE. Fix issues with inconsistency of the order of processed attributes.