Merge pull request #15 from jsumners/attrs_rework

Adds missing check for valid attributes