Minor edits to javascript