IE11 compatibility

Hi,

This is a little modification to get IE11 compatibility.

I tried it with IE11 and windows 8.

This pull request include my last fix named "fix context issue".

Gabriel