Fix in IE7 as suggested by @siggioskarsson in #342