Fixed bug in selectastree method