Added tree selection also to generic agent.