Attribute methods

I’ve found a (admittedly pretty obscure) bug whilst trying to figure out how attributes are handled.

The fix involves a (minor) change in behaviour, but I think the original behaviour may be a bug anyway.

Thoughts?