Adding full tree tracking for instances
A few fixes and added assertions
A few more fixes