Some changes to fix compatibility issues with IE

Some changes to fix compatibility issues with IE