Revert "Revert "Merge pull request #276 from shatterednirvana/persistence-finally""

This reverts commit 35e10c15bce8e6159682a18b294c3e03f6d36ce9.