Fixed enum check for attributes/embedded types
Fix a bug in generic type checking