Added "empty" check for weight in menu items, before assigning a default value.