Saving with pickle now seems to work.