Fix NameError in __setstate__