Tidied up MAKE_ITEM_GRADECODE a little.