IE <=8 fix
IE Fix
Some code refactor, added better error handling
Merge pull request #51 from isuftin/master

IE fixes, code refactor, error handling