Fix problem with .trim() in IE8