Fix JavaScript errors in proxy