Check for existence of trait and trigger a more meaningful notice than 'Undefined index' (see #234)
Merge pull request #298 from naitsirch/issue234

Check for existence of trait and throw descriptive exception