Fixed bugs in web.js