update JavaScript; more fixes