Bug fix: Forgot to finalize some sqlite statements. Might have resulted in the following error message: “Error in sqlite_close: 5 unable to close due to unfinalised statements”