Javascript - minor edits