minor JS fixes for edit functions