A bunch of compatibility changes and a fix for the browser's event handling.