Fix SQLite bug