Bug/151 order of attributes change when saving

Fixes #151