Fixed renaming bug in different scopes.