few JS fixes