Fixes pickling issue cPickle.PicklingError: persistent id must be string