Fixed bug with treename