New function journal_count_entries() and more accurate counting of