Fix retrieval of trees