Minor fixes to pickling.