Fixed substr issue with IE
Merge pull request #1 from togge/master

Fixed an issue with IE.