Changed the table writer to use the same database as the GUIs.