Some JS fixes