fixed error in min_tree return