Fixed two tricky bugs with some initialization edge cases but big consequences.

- Fixed a bug where shared colelction among derived classes would not work
  consistently.

- Fixed a bug during initialization of persistent sub-objects in that changes
  would not be seen in the transaction once the datamanger was flushed.