Additional fix for DISTINCT/OFFSET bug (take 2)