Fix compatibility with modern browsers