Fixes to persistence layer.