Some SQLite fixes