Fix some more syntax errors. Switched to sqlite3