Fix bug in buildTree method