Fix for IE8
Merge pull request #488 from danvk/ie8-fix

Fix for IE8