Fixes to persistence handling.