Fix python3 pickle bug #391

cc #391