Fix query generator interface