fix some cross-browser bugs