Fix SQLite script bug