Improve and fix webCommands.js