Fix cross browser compatibility issues