Add check for categorical domains in trick 5806f1dd0