Fix persistence examples

Various small fixes, correction in persistence example.