Small performance improvements in JavaScript code.