Fix typo and out of scope var. Pass in root directly to prevent look up.