Fix NameError in datastructures.py