fix several issues causing errors in IE8 and IE9
Merge pull request #45 from switchfly/master

Some minor fixes that causes errors in IE8 and IE9