Fixes bugs in IE7/8