Fixed an issue where elements added via the adoption agency algorithm did not preserve their attributes.

Fixes #313