fix SQLite syntax errors