Added checks to ensure that the directory where the SQLite file will be saved actually exists.  This should help prevent the process failing after a few minutes when we attempt to write to the SQLite file.