Some small JS fixes