Added missing return object in treeByLevel()