Fixed bug resulting in duplicate linkage in the DB between elements.