Some cleanup of the JavaScript.