Updated persistence to be a bit more robust.