Fixing SQLite refs