improved exception messages in ClassMetadata