Fixed bug in IE8 with string.trim()