Dot tree fix

There was a strange bug caused by the refactoring. The bug is now fixed.