Persistence bug fixes