Fix error if count of migration tables is zero