fixes for gbmin/gbmax being first query term.