Fixed some cross-browser compatibility