Sqlite fixes