Fixed the pickling-unpickling