Detect unifibility for chained queries correctly