Fix pickle bug in Python 2