Added more flexible pickling