Ugly fix for offsetWidth bug