Improvements to persistence test code