Fix #0015420: Invalid category check is not made

Shouldn't the comment about being valid be above the appropriate check rather than here?