Implemented proper iterator for 1D query results