More debugging. Now the program works even with no .db file to start.