Fix graph unpickling bug with Python 2