Some improvements on the JS.