Fix a minor JS bug with menu creation.