JS fixes (in progress)