Fixed #17; Removed global variable `root`