Fix fetch for queries with SQLite