Add python3 support
Fix persistence bug