Persistence bug fix.
Should work correctly when resuming and on first run.