Fixes bug in IE, where all attributes have empty value after sanitizing.