Lightly refactor tests and add tests for attribute setting
Fix attributes support