Fix JavaScript for Chrome.