Better pickling support. Fix GH-23