Minor JavaScript corrections