Fixed SQLite bug