Fix serialization of Attributes.

Serializing in wrong order was causing crash on :reload.

Fixes #678.