Fix a JS bug