Fixed a weird non-deterministic bug in IE