fix: formal attributes were not being included in all attributes

@trungdong - do check these changes before merging.

i still don't quite like the fact that a property changes object attributes. but i didn't go through the code in enough detail to see how that can be avoided.