free() up tree after use, fixed list traversal error