[FIX] Fixed bug with invalid number of tables and ambiguity with tables
containing last row id both for Cycle and Daily Tables in case of single
database.
[FIX] Passed unit-test for table persistense.