various browser compatibility fixes, esp. chrome