Previously the code would enter an infinite loop that never finished.
Now we just delete the database file and re-initialize the database.
Added an autotest