Add IE support (Fix #12)

This just fixes some small issues so that everything works on IE9 and above.