Added back in removed lines and put in checks for sqlite3 instead.