Fixing logging and unit test of persist