Fix IE mode and remove unneeded code