Fix IE7 and IE8 compatibility
Merge pull request #50 from michaelperrin/fix/ie8-compatibility

Fix IE7 and IE8 compatibility