Minor fix to JS validation