[bugfix] fixed variable references in tree.map